Browse Source

获取主用户修改2

chenshibin 4 years ago
parent
commit
bddc6e005a
1 changed files with 13 additions and 8 deletions
  1. 13 8
      Controller/EquipmentManagerV3.py

+ 13 - 8
Controller/EquipmentManagerV3.py

@@ -734,16 +734,21 @@ class EquipmentManagerV3(View):
         dvq = dvq.filter(~Q(vodPrimaryUserID='')).values('vodPrimaryUserID')
         qs = {}
         if dvq.exists():
-            qs = Device_User.objects.filter(userID=dvq[0]['vodPrimaryUserID']).values('userID', 'NickName', 'username', 'userEmail', 'phone')
-            if qs[0]['NickName'] == '':
-                qs[0]['NickName'] = qs[0]['username']
+            qs = Device_User.objects.filter(userID=dvq[0]['vodPrimaryUserID']).values('userID', 'NickName', 'username',
+                                                                                      'userEmail', 'phone')
+            NickName = qs[0]['username']
+            userEmail = qs[0]['userEmail']
+            phone = qs[0]['phone']
+            username = qs[0]['username']
+            qs = CommonService.qs_to_list(qs)
+            if NickName == '':
+                qs[0]['NickName'] = username
 
-            if qs[0]['userEmail'] == '':
-                qs[0]['userEmail'] = qs[0]['NickName']
+            if userEmail == '':
+                qs[0]['userEmail'] = NickName
 
-            if qs[0]['phone'] == '':
-                qs[0]['phone'] = qs[0]['NickName']
-            qs = CommonService.qs_to_list(qs)
+            if phone == '':
+                qs[0]['phone'] = NickName
 
         # if not qs:
         #     uidq = UIDMainUser.objects.filter(UID=UID).values('user_id')