|
@@ -558,17 +558,29 @@ class EquipmentManagerV3(View):
|
|
|
if page and line:
|
|
|
page = int(page)
|
|
|
line = int(line)
|
|
|
- device_qs = Device_Info.objects.filter(userID=userID)
|
|
|
- device_qs = device_qs.filter(~Q(isExist=2))
|
|
|
- if device_qs.exists():
|
|
|
+ device_qs_list = Device_Info.objects.filter(userID=userID)
|
|
|
+ device_qs_list = device_qs_list.filter(~Q(isExist=2))
|
|
|
+ if device_qs_list.exists():
|
|
|
if fuzzy:
|
|
|
- device_qs = device_qs.filter(Q(UID__contains=fuzzy) | Q(NickName__contains=fuzzy))
|
|
|
-
|
|
|
- device_qs = device_qs.values('id', 'userID', 'NickName', 'UID', 'View_Account',
|
|
|
- 'View_Password', 'ChannelIndex', 'Type', 'isShare',
|
|
|
- 'primaryUserID', 'primaryMaster', 'data_joined', 'vodPrimaryUserID',
|
|
|
- 'vodPrimaryMaster', 'userID__userEmail',
|
|
|
- 'version', 'isVod', 'isExist', 'NotificationMode', 'isCameraOpenCloud', 'serial_number')
|
|
|
+ device_qs = device_qs_list.filter(Q(UID__contains=fuzzy) | Q(NickName__contains=fuzzy))
|
|
|
+ if not device_qs.exists():
|
|
|
+ fuzzy2 = fuzzy.swapcase()
|
|
|
+ device_qs = device_qs_list.filter(Q(UID__contains=fuzzy2) | Q(NickName__contains=fuzzy2))
|
|
|
+ device_qs = device_qs.values('id', 'userID', 'NickName', 'UID', 'View_Account',
|
|
|
+ 'View_Password', 'ChannelIndex', 'Type', 'isShare',
|
|
|
+ 'primaryUserID', 'primaryMaster', 'data_joined', 'vodPrimaryUserID',
|
|
|
+ 'vodPrimaryMaster', 'userID__userEmail',
|
|
|
+ 'version', 'isVod', 'isExist', 'NotificationMode', 'isCameraOpenCloud',
|
|
|
+ 'serial_number')
|
|
|
+ else:
|
|
|
+ device_qs = device_qs_list.values('id', 'userID', 'NickName', 'UID', 'View_Account',
|
|
|
+ 'View_Password', 'ChannelIndex', 'Type', 'isShare',
|
|
|
+ 'primaryUserID', 'primaryMaster', 'data_joined',
|
|
|
+ 'vodPrimaryUserID',
|
|
|
+ 'vodPrimaryMaster', 'userID__userEmail',
|
|
|
+ 'version', 'isVod', 'isExist', 'NotificationMode',
|
|
|
+ 'isCameraOpenCloud',
|
|
|
+ 'serial_number')
|
|
|
|
|
|
dvls = CommonService.qs_to_list(device_qs)
|
|
|
uid_list = []
|