blt all 只返回在线标签

This commit is contained in:
曹前明 2022-10-19 09:42:55 +08:00
parent cfc6b072c6
commit e439278da5
1 changed files with 6 additions and 3 deletions

View File

@ -97,9 +97,12 @@ class BltViewSet(CustomGenericViewSet):
blt_list = res['recordList']
macs = []
for i in blt_list:
if 'userId' in i:
i['mac'] = i['userId']
macs.append(i['mac'])
if 'online' in i and i['online'] == False:
pass
else:
if 'userId' in i:
i['mac'] = i['userId']
macs.append(i['mac'])
qs = self.queryset.filter(code__in=macs).exclude(employee=None)
if data.get('depts', []):
qs = qs.filter(employee__belong_dept=data['depts'])