Browse Source

查询推送列表只过滤最近7天返回

chenshibin 3 năm trước cách đây
mục cha
commit
b9351e96fc
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      Controller/DetectControllerV2.py

+ 4 - 0
Controller/DetectControllerV2.py

@@ -261,7 +261,11 @@ class DetectControllerViewV2(View):
         if not region:
             return response.json(444, 'region')
         region = int(region)
+        now_time = int(time.time())
+
         qs = Equipment_Info.objects.filter(userID_id=userID).order_by('-eventTime')
+        qs = qs.filter(endTime__gt=now_time - 3600 * 168)
+
         if startTime and endTime:
             qs = qs.filter(eventTime__range=(startTime, endTime))
         if eventType: