zhangyong há 1 ano atrás
pai
commit
68c97884fd
1 ficheiros alterados com 21 adições e 13 exclusões
  1. 21 13
      video_agc/agc_video_method.py

+ 21 - 13
video_agc/agc_video_method.py

@@ -31,23 +31,31 @@ class AgcVidoe():
             formatted_current_time = current_time.strftime("%Y-%m-%d")
             formatted_three_days_ago = three_days_ago.strftime("%Y-%m-%d")
             if limit_count == 1:
-                url_list = f"""SELECT a.video_id, a.account_id, a.oss_object_key FROM agc_video_url a LEFT JOIN agc_video_deposit b ON a.oss_object_key = b.oss_object_key 
-                                            AND b.time -= '{formatted_current_time}' 
-                                            WHERE b.video_id IS NULL 
-                                            AND a.account_id = '{user}' 
-                                            AND a.status = 1 
-                                            AND a.mark = '{mark}' limit {limit_count};"""
+                url_list = f"""SELECT a.video_id, a.account_id, a.oss_object_key 
+                               FROM agc_video_url a 
+                               LEFT JOIN agc_video_deposit b 
+                               ON a.oss_object_key = b.oss_object_key 
+                               AND b.time = '{formatted_current_time}' 
+                               WHERE b.video_id IS NULL 
+                               AND a.account_id = '{user}' 
+                               AND a.status = 1 
+                               AND a.mark = '{mark}' 
+                               LIMIT {limit_count};"""
                 url_list = MysqlHelper.get_values(url_list, "prod")
                 if url_list:
                     return url_list
             else:
-                url_list = f"""SELECT a.video_id, a.account_id, a.oss_object_key FROM agc_video_url a LEFT JOIN agc_video_deposit b ON a.oss_object_key = b.oss_object_key 
-                                            AND b.time >= '{formatted_three_days_ago}' 
-                                            AND b.time <= '{formatted_current_time}' 
-                                            WHERE b.video_id IS NULL 
-                                            AND a.account_id = '{user}' 
-                                            AND a.status = 1 
-                                            AND a.mark = '{mark}' limit {limit_count};"""
+                url_list = f"""SELECT a.video_id, a.account_id, a.oss_object_key 
+                               FROM agc_video_url a 
+                               LEFT JOIN agc_video_deposit b 
+                               ON a.oss_object_key = b.oss_object_key 
+                               AND b.time >= '{formatted_three_days_ago}' 
+                               AND b.time <= '{formatted_current_time}' 
+                               WHERE b.video_id IS NULL 
+                               AND a.account_id = '{user}' 
+                               AND a.status = 1 
+                               AND a.mark = '{mark}' 
+                               LIMIT {limit_count};"""
                 Common.logger("gs_video").info(f"{mark}sql{url_list} ")
                 url_list = MysqlHelper.get_values(url_list, "prod")
                 Common.logger("gs_video").info(f"{mark}查询数据{url_list} ")