Jelajahi Sumber

优化运营成本统计

peng 1 tahun lalu
induk
melakukan
c9835921b8

+ 2 - 3
AdminController/dataSystemManagement/OperatingCostsDataController.py

@@ -61,7 +61,7 @@ class OperatingCostsDataView(View):
         line = int(line)
         try:
             if start_time and end_time:
-                operating_costs_qs = OperatingCosts.objects.filter(Q(time__gte=start_time), Q(time__lte=end_time))
+                operating_costs_qs = OperatingCosts.objects.filter(time__gte=start_time, time__lte=end_time)
             else:
                 operating_costs_qs = OperatingCosts.objects.all()
             count = operating_costs_qs.count()
@@ -71,8 +71,7 @@ class OperatingCostsDataView(View):
                                                      'end_time', 'created_time', 'start_time', 'time', 'storage_cost',
                                                      'api_cost', 'profit', 'profit_margin', 'fee', 'flow_cost',
                                                      'real_income', 'price', 'region', 'country_name',
-                                                     'order_type', 'expire').order_by(
-                '-time')[(page - 1) * line:page * line]
+                                                     'order_type', 'expire')[(page - 1) * line:page * line]
             return response.json(0, {'count': count, 'res': list(operating_qs)})
         except Exception as e:
             print('error')