From 0137da7479704264cef70ed33ccc02ea9dc52b21 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:53:13 +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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/third/views_d.py b/apps/third/views_d.py index fb622632..d7f49192 100644 --- a/apps/third/views_d.py +++ b/apps/third/views_d.py @@ -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: