wangkun преди 2 години
родител
ревизия
c74347a17b
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      xiaoniangao/xiaoniangao_hour/xiaoniangao_hour.py

+ 1 - 1
xiaoniangao/xiaoniangao_hour/xiaoniangao_hour.py

@@ -469,7 +469,7 @@ class XiaoniangaoHour:
         try:
             befor_yesterday = (datetime.date.today() + datetime.timedelta(days=-3)).strftime("%Y-%m-%d %H:%M:%S")
             update_time_stamp = int(time.mktime(time.strptime(befor_yesterday, "%Y-%m-%d %H:%M:%S")))
-            select_sql = f""" select * from crawler_xiaoniangao_hour where crawler_time_stamp >= {update_time_stamp} """
+            select_sql = f""" select * from crawler_xiaoniangao_hour where crawler_time_stamp >= {update_time_stamp} GROUP BY out_video_id """
             update_video_list = MysqlHelper.get_values(log_type, crawler, select_sql, env)
             if len(update_video_list) == 0:
                 Common.logger(log_type, crawler).info("暂无需要更新的小时榜数据\n")