chenshibin 4 жил өмнө
parent
commit
cd9f9337c4

+ 9 - 4
Controller/EquipmentManagerV3.py

@@ -595,7 +595,12 @@ class EquipmentManagerV3(View):
         return password
 
     def do_mainUserDevice(self, request_dict, response):
-        vodPrimaryUserID = request_dict.get('vodPrimaryUserID')
-        qs = Device_User.objects.filter(userID=vodPrimaryUserID).values('NickName', 'username', 'userEmail', 'phone')
-        dvql = CommonService.qs_to_list(qs)
-        return response.json(0, dvql)
+        UID = request_dict.get('UID')
+        dvq = Device_Info.objects.filter(UID=UID)
+        dvq = dvq.filter(~Q(vodPrimaryUserID='')).values('vodPrimaryUserID')
+        qs = {}
+        if dvq.exists():
+            qs = Device_Info.objects.filter(userID=dvq[0]['vodPrimaryUserID']).values('NickName', 'username', 'userEmail', 'phone')
+            qs = CommonService.qs_to_list(qs)
+
+        return response.json(0, qs)