浏览代码

客流统计优化当前小时数据查询

zhangdongming 1 年之前
父节点
当前提交
f34b2d195a
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Controller/AlgorithmShop/AlgorithmShopController.py

+ 5 - 1
Controller/AlgorithmShop/AlgorithmShopController.py

@@ -488,7 +488,7 @@ class AlgorithmShopView(View):
         passenger_flow_list = []
         pf_qs = DeviceAlgorithmPassengerFlow.objects.filter(
             device_time__gte=t_list[23],
-            device_time__lte=t_list[0],
+            device_time__lte=t_list[0] + 60,
             type=int(flow_type),
             uid=uid
         ).order_by('device_time')
@@ -510,6 +510,10 @@ class AlgorithmShopView(View):
                     count += item.count
                     hour = item.statistical_time.hour
                     is_data = True
+                elif next_time == -1 and current_time < item.device_time:
+                    hour = item.statistical_time.hour
+                    count += item.count
+                    is_data = True
             if not is_data:
                 continue
             passenger_flow_list.append({