s
This commit is contained in:
1 parent
cf662895e5
commit
ac04fad613
8 files changed
+11
-5
No files matched your search
Binary file not shown.
@@ -83,7 +83,8 @@ const routes = [
|
||||
name: 'AboutPortalPage',
|
||||
component: () => import('@/views/AboutPortalPage.vue'),
|
||||
meta:{
|
||||
title:"О портале"
|
||||
title:"О портале",
|
||||
ico: "mdi-contact-mail"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -66,7 +66,9 @@ export function pagecounter(){
|
||||
console.log(router.currentRoute.value.meta, '-------------ttt------------------');
|
||||
let postdata = {user__id: "user" in accountStore &&"id" in accountStore.user? accountStore.user.id: null,
|
||||
page: router.currentRoute.value.meta.title,
|
||||
fullPath: router.currentRoute.value.fullPath
|
||||
fullPath: router.currentRoute.value.fullPath,
|
||||
ico: router.currentRoute.value.ico
|
||||
|
||||
|
||||
}
|
||||
clearAxios.post(`${baseURL}api/watcher/counter/`, postdata)
|
||||
|
||||
@@ -210,6 +210,8 @@ class DailyRoundUpAPIView(APIView):
|
||||
|
||||
|
||||
def post(self, request):
|
||||
|
||||
# DictCommitteeExpert.objects.using('user_directory').update(fio='kfkf', tel='03')
|
||||
|
||||
user = DictEmployee.objects.using('user_directory').filter(deleted=0).values('login', 'id')
|
||||
dfuser = pd.DataFrame.from_records(user)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -9,6 +9,7 @@ class CountVisitor(models.Model):
|
||||
user = models.ForeignKey(User, null=True, blank=True, on_delete=models.PROTECT)
|
||||
count = models.IntegerField(default=0)
|
||||
fullPath = models.CharField(max_length=255)
|
||||
ico = models.CharField(verbose_name='Иконка', max_length=150, null=True, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return str(self.page)
|
||||
@@ -18,7 +19,7 @@ class CountVisitor(models.Model):
|
||||
class Meta:
|
||||
|
||||
constraints = [
|
||||
models.UniqueConstraint(fields=['page', 'user', 'visitdate', 'fullPath'], name='unique appversion')
|
||||
models.UniqueConstraint(fields=['page', 'user', 'visitdate', 'fullPath', 'ico'], name='unique appversion')
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ class Counter(ListAPIView):
|
||||
|
||||
def post(self, request):
|
||||
if request.data['user__id'] is not None:
|
||||
watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today(), fullPath=request.data['fullPath'])
|
||||
watch,create = CountVisitor.objects.get_or_create(user = User(id=request.data['user__id']),page=request.data['page'], visitdate=date.today(), fullPath=request.data['fullPath'], ico=request.data['ico'])
|
||||
else:
|
||||
watch,create = CountVisitor.objects.get_or_create(user__id__isnull=True, page=request.data['page'], visitdate=date.today(), fullPath=request.data['fullPath'])
|
||||
watch,create = CountVisitor.objects.get_or_create(user__id__isnull=True, page=request.data['page'], visitdate=date.today(), fullPath=request.data['fullPath'], ico=request.data['ico'])
|
||||
watch.count+=1
|
||||
watch.save()
|
||||
|
||||
|
||||
Reference in new issue
Block a user