Przeglądaj źródła

添加channelType字段

syh 4 lat temu
rodzic
commit
e2536b922c
2 zmienionych plików z 14 dodań i 6 usunięć
  1. 8 0
      Test.py
  2. 6 6
      ai_time_task_creative_handler.py

+ 8 - 0
Test.py

@@ -0,0 +1,8 @@
+import datetime
+
+def main():
+    getdate = (datetime.datetime.now() + datetime.timedelta(days=-60)).strftime("%Y-%m-%d %H:%M:%S");
+    print(getdate)
+
+if __name__ == '__main__':
+    main()

+ 6 - 6
ai_time_task_creative_handler.py

@@ -42,7 +42,7 @@ class AiHistoricalMissingMaterial(tornado.web.RequestHandler):
                     (account_id, os.getpid(), os.getppid(), data))
         try:
             sql = """
-            select account_id, single_appid, app_id_array, general_track from ctop_ai_kuaishou_advertiser_strategy
+            select account_id, single_appid, app_id_array, general_track ,channel_type from ctop_ai_kuaishou_advertiser_strategy
             where account_id=%s  order by create_time desc limit 1
             """ % account_id
             df = pd.read_sql(sql, engine)
@@ -189,7 +189,7 @@ class AiAutoCreative(tornado.web.RequestHandler):
             refresh_video(account_id=account_id, url=refresh_video_url)
 
             sql = """
-                        select account_id, single_appid, app_id_array, general_track from ctop_ai_kuaishou_advertiser_strategy
+                        select account_id, single_appid, app_id_array, general_track,channel_type from ctop_ai_kuaishou_advertiser_strategy
                         where account_id=%s order by create_time desc limit 1
                         """ % account_id
             df = pd.read_sql(sql, engine)
@@ -342,7 +342,7 @@ class AiHighQualityMaterial(tornado.web.RequestHandler):
         logger.info("账户信息=%s, 当前进程=%s, 当前进程的主进程=%s,  raw data from request is %s" %
                     (account_id, os.getpid(), os.getppid(), data))
         try:
-            sql = """select account_id, single_appid, app_id_array, general_track from ctop_ai_kuaishou_advertiser_strategy
+            sql = """select account_id, single_appid, app_id_array, general_track,channel_type from ctop_ai_kuaishou_advertiser_strategy
                      where account_id=%s  order by create_time desc limit 1
                      """ % account_id
             df = pd.read_sql(sql, engine)
@@ -552,7 +552,7 @@ class AiUpCreativeByHour(tornado.web.RequestHandler):
                     
                 if video_list['code'] == 0:
                     # 根据获取到的视频进行创建
-                    sql = """select account_id, single_appid, app_id_array, general_track from ctop_ai_kuaishou_advertiser_strategy
+                    sql = """select account_id, single_appid, app_id_array, general_track, channel_type from ctop_ai_kuaishou_advertiser_strategy
                              where account_id=%s order by create_time desc limit 1""" % account_id
                     df = pd.read_sql(sql, engine)
                     if df['general_track'].values[0] == 0:
@@ -720,7 +720,7 @@ class AiProgramCreativeHighQualityMaterial(tornado.web.RequestHandler):
         logger.info("账户信息=%s, 当前进程=%s, 当前进程的主进程=%s,  raw data from request is %s" %
                     (account_id, os.getpid(), os.getppid(), data))
         try:
-            sql = """select account_id, single_appid, app_id_array, general_track from ctop_ai_kuaishou_advertiser_strategy
+            sql = """select account_id, single_appid, app_id_array, general_track,channel_type from ctop_ai_kuaishou_advertiser_strategy
                      where account_id=%s  order by create_time desc limit 1
                   """ % account_id
             df = pd.read_sql(sql, engine)
@@ -903,7 +903,7 @@ class AiProgramCreativeNewMaterial(tornado.web.RequestHandler):
         logger.info("账户信息=%s, 当前进程=%s, 当前进程的主进程=%s,  raw data from request is %s" %
                     (account_id, os.getpid(), os.getppid(), data))
         try:
-            sql = """select account_id, single_appid, app_id_array, general_track from ctop_ai_kuaishou_advertiser_strategy
+            sql = """select account_id, single_appid, app_id_array, general_track,channel_type from ctop_ai_kuaishou_advertiser_strategy
                      where account_id=%s  order by create_time desc limit 1
                   """ % account_id
             df = pd.read_sql(sql, engine)