Explorar el Código

修改添加智能按钮逻辑

peng hace 2 años
padre
commit
6d07a044cb

+ 1 - 1
Controller/Cron/CronTaskController.py

@@ -401,7 +401,7 @@ class CronCollectDataView(View):
         try:
             created_time = int(time.time())
             today = datetime.datetime.today()
-            start_time = datetime.datetime(today.year, today.month, 23)
+            start_time = datetime.datetime(today.year, today.month, today.day)
             end_time = start_time + datetime.timedelta(days=1)
             increase_user_qs = Device_User.objects.filter(data_joined__gte=start_time, data_joined__lt=end_time).values(
                 'data_joined',

+ 1 - 1
Controller/SensorGateway/SubDeviceController.py

@@ -110,7 +110,7 @@ class GatewaySubDeviceView(View):
                 return response.json(174)
             if device_type == SENSOR_TYPE['smart_button']:
                 sub_device_qs = GatewaySubDevice.objects.filter(device_id=device_id, device_type=device_type)
-                if sub_device_qs.count() > 3:
+                if sub_device_qs.count() >= 3:
                     return response.json(181)
 
             with transaction.atomic():