blt all 只返回在线标签

This commit is contained in:
曹前明 2022-10-19 09:53:13 +08:00
parent e439278da5
commit 0137da7479
1 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,8 @@ class BltViewSet(CustomGenericViewSet):
blt_list = res['recordList']
macs = []
for i in blt_list:
macs.append(i['mac'])
if 'online' in i and i['online']:
macs.append(i['mac'])
qs = self.queryset.filter(code__in=macs).exclude(employee=None)
ret['total'] = qs.count()
ret['count_employee'] = qs.filter(employee__type='employee').count()
@ -97,7 +98,7 @@ class BltViewSet(CustomGenericViewSet):
blt_list = res['recordList']
macs = []
for i in blt_list:
if 'online' in i and i['online'] == False:
if 'online' in i and i['online'] is False:
pass
else:
if 'userId' in i: