Ver código fonte

解决statistcsPushMonth函数的计算异常

tanghongbin 4 anos atrás
pai
commit
e05e1c050b
1 arquivos alterados com 5 adições e 4 exclusões
  1. 5 4
      Controller/StatisticsController.py

+ 5 - 4
Controller/StatisticsController.py

@@ -206,15 +206,15 @@ def statistcsPushMonth(request):
 
     gmtime = time.gmtime(int(time.time()) + 28800)
     current_month = gmtime.tm_mon - 1
-    print(current_month)
+    # print(current_month)
 
     time_struct = [gmtime.tm_year, current_month, 1, 0, 0, 0, 0, 0, gmtime.tm_isdst]
     start_time = int(time.mktime(tuple(time_struct))) - 28800
-    print(start_time)
+    # print(start_time)
 
     time_struct[1] = current_month + 1
     end_time = int(time.mktime(tuple(time_struct))) - 28800
-    print(end_time)
+    # print(end_time)
 
     eq_qs = EquipmentInfoExStatisticsModel.objects.filter(statistics_date__gte=start_time, statistics_date__lte=end_time, date_type=0)
     # 0:APNS推送,1:谷歌推送,2:极光推送
@@ -230,7 +230,8 @@ def statistcsPushMonth(request):
             do_sum_two(eq, gcm)
         elif eq.push_type == 2:
             do_sum_two(eq, jpush)
-        do_sum_two(eq, total)
+        elif eq.push_type == -1:
+            do_sum_two(eq, total)
     datas = []
     datas.append(apns)
     datas.append(gcm)