From e439278da5604366a39889332fe2faa2aca9fedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=B9=E5=89=8D=E6=98=8E?= <909355014@qq.com> Date: Wed, 19 Oct 2022 09:42:55 +0800 Subject: [PATCH] =?UTF-8?q?blt=20all=20=E5=8F=AA=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/third/views_d.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/third/views_d.py b/apps/third/views_d.py index 01ec0207..fb622632 100644 --- a/apps/third/views_d.py +++ b/apps/third/views_d.py @@ -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'])