瀏覽代碼

后台用户提现申请审核列表

linhaohong 1 年之前
父節點
當前提交
5fc321ba41
共有 1 個文件被更改,包括 13 次插入1 次删除
  1. 13 1
      AdminController/CloudServiceManage/AgentDeviceController.py

+ 13 - 1
AdminController/CloudServiceManage/AgentDeviceController.py

@@ -227,7 +227,19 @@ class AgentDeviceView(View):
 
             result = self.calculate_profit_or_revenue(agent_device_orders, package_details, timeUnit, metric_type,
                                                       start_time, end_time)
-            return response.json(0, {'list': result})
+            total_4G = Decimal('0.00')
+            total_cloud = Decimal('0.00')
+            # 遍历result列表来累加4G和云存的值
+            for item in result:
+                total_4G = item['4G'] + total_4G
+                total_cloud = item['云存'] + total_cloud
+            response_data = {
+                    "list": result,
+                    "total_4G": total_4G,  # 4G的总和
+                    "total_云存": total_cloud,  # 云存的总和
+            }
+
+            return response.json(0, response_data)
 
         except Exception as e:
             error_msg = f"error_line:{traceback.format_exc()}, error_msg:{str(e)}"