Procházet zdrojové kódy

定时删除根据添加时间判断

zhangdongming před 3 roky
rodič
revize
bc19353f96
1 změnil soubory, kde provedl 8 přidání a 8 odebrání
  1. 8 8
      Controller/Cron/CronTaskController.py

+ 8 - 8
Controller/Cron/CronTaskController.py

@@ -75,23 +75,23 @@ class CronDelDataView(View):
             # 每次删除条数
             size = 10000
             # 删除7天前的数据
-            sql = "DELETE FROM equipment_info WHERE eventTime<= %s LIMIT %s "
+            sql = "DELETE FROM equipment_info WHERE addTime<= %s LIMIT %s "
             for i in range(6):
                 cursor.execute(sql, [expiration_time, size])
             if week_val == 1:
-                sql = "DELETE FROM equipment_info_sunday WHERE event_time<= %s LIMIT %s "
+                sql = "DELETE FROM equipment_info_sunday WHERE add_time<= %s LIMIT %s "
             if week_val == 2:
-                sql = "DELETE FROM equipment_info_monday WHERE event_time<= %s LIMIT %s "
+                sql = "DELETE FROM equipment_info_monday WHERE add_time<= %s LIMIT %s "
             if week_val == 3:
-                sql = "DELETE FROM equipment_info_tuesday WHERE event_time<= %s LIMIT %s "
+                sql = "DELETE FROM equipment_info_tuesday WHERE add_time<= %s LIMIT %s "
             if week_val == 4:
-                sql = "DELETE FROM equipment_info_wednesday WHERE event_time<= %s LIMIT %s "
+                sql = "DELETE FROM equipment_info_wednesday WHERE add_time<= %s LIMIT %s "
             if week_val == 5:
-                sql = "DELETE FROM equipment_info_thursday WHERE event_time<= %s LIMIT %s "
+                sql = "DELETE FROM equipment_info_thursday WHERE add_time<= %s LIMIT %s "
             if week_val == 6:
-                sql = "DELETE FROM equipment_info_friday WHERE event_time<= %s LIMIT %s "
+                sql = "DELETE FROM equipment_info_friday WHERE add_time<= %s LIMIT %s "
             if week_val == 7:
-                sql = "DELETE FROM equipment_info_saturday WHERE event_time<= %s LIMIT %s "
+                sql = "DELETE FROM equipment_info_saturday WHERE add_time<= %s LIMIT %s "
             for i in range(5):
                 cursor.execute(sql, [expiration_time, size])
             # 关闭游标