Browse Source

查询全部分组排除当前查询分组设备

locky 3 tuần trước cách đây
mục cha
commit
635ae57ecc
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Controller/DeviceManagement/DeviceGroupController.py

+ 1 - 1
Controller/DeviceManagement/DeviceGroupController.py

@@ -95,7 +95,7 @@ class DeviceGroupView(View):
             res = []
             # 查询全部设备
             if device_group_id != '0':
-                device_info_qs = Device_Info.objects.filter(userID=user_id). \
+                device_info_qs = Device_Info.objects.filter(~Q(device_group_id=device_group_id), userID=user_id). \
                     values('id', 'NickName', 'Type')
                 if device_info_qs.exists():
                     data = {