ソースを参照

优化流失预警

guanhailong 2 年 前
コミット
9065b59aed
1 ファイル変更4 行追加3 行削除
  1. 4 3
      AdminController/ServeManagementController.py

+ 4 - 3
AdminController/ServeManagementController.py

@@ -1394,13 +1394,13 @@ class serveManagement(View):
                 order_qs = Order_Model.objects.filter(order_type=0, userID=userID).values('UID').annotate(count=Count('UID'))
                 order_qs = Order_Model.objects.filter(order_type=0, userID=userID).values('UID').annotate(count=Count('UID'))
                 #  用户设备购买云存数量
                 #  用户设备购买云存数量
                 if not order_qs.exists():
                 if not order_qs.exists():
-                    count = ''
+                    device_count = ''
                 else:
                 else:
                     uid_count = order_qs.count()
                     uid_count = order_qs.count()
                     if uid_count == 1:
                     if uid_count == 1:
-                        count = 'N/A'
+                        device_count = 'N/A'
                     else:
                     else:
-                        count = uid_count
+                        device_count = uid_count
                 order_uid_list = [order[uid] for order in order_qs for uid in order]
                 order_uid_list = [order[uid] for order in order_qs for uid in order]
                 vod_hls_qs = VodHlsModel.objects.filter(uid__in=order_uid_list).values('uid')
                 vod_hls_qs = VodHlsModel.objects.filter(uid__in=order_uid_list).values('uid')
                 #  套餐使用期间是否上传过数据
                 #  套餐使用期间是否上传过数据
@@ -1419,6 +1419,7 @@ class serveManagement(View):
                     'day': day,
                     'day': day,
                     'other': other,
                     'other': other,
                     'username': username,
                     'username': username,
+                    'count': device_count,
                 }
                 }
                 attrition_list.append(data)
                 attrition_list.append(data)
             test_list = [list for list in attrition_list if list['day'] > 14]  # 输出15天及以上的数据
             test_list = [list for list in attrition_list if list['day'] > 14]  # 输出15天及以上的数据