ck 4 年 前
コミット
bae1afb164
3 ファイル変更12 行追加6 行削除
  1. 4 4
      app/api_data/cost_util.py
  2. 2 0
      app/dailyRun.py
  3. 6 2
      app/etl/dw/dw_image_cost_day.py

+ 4 - 4
app/api_data/cost_util.py

@@ -530,15 +530,15 @@ def mysql_insert_adcreative(data):
 
 
 if __name__ == '__main__':
-    account_id = 14629666
-    access_token = 'e1c074d5e1a71435a52c1078f9d5804c'
+    account_id = 19206910
+    access_token = '89079ccc8db047b078a0108e36a7e276'
     #
     account_id2 = 14709511
     access_token2 = 'e87f7b6f860eaeef086ddcc9c3614678'
-    get_ad_cost_day(account_id,access_token,'MP','2021-04-05','2021-04-05')
+    get_ad_cost_day(account_id,access_token,'MP','2021-04-09','2021-04-09')
 
 
-    get_adcreatives(account_id,access_token,'MP','3187867673','2021-04-09')
+    # get_adcreatives(account_id,access_token,'MP','3187867673','2021-04-09')
 
 
 

+ 2 - 0
app/dailyRun.py

@@ -2,6 +2,7 @@ from app.api_data import get_order
 from app.etl import data_stat_run
 from model.DateUtils import DateUtils
 from app.api_data import get_cost
+from app.etl.dw import dw_image_cost_day
 du = DateUtils()
 
 
@@ -20,6 +21,7 @@ if __name__ == '__main__':
 
     # 广告数据
     get_cost.day()
+    dw_image_cost_day.day()
 
 
 

+ 6 - 2
app/etl/dw/dw_image_cost_day.py

@@ -65,11 +65,15 @@ def hourly():
     except:
         DingTalkUtils.send("广告数据清洗失败")
 
+def day():
+    for i in du.getDateLists(du.get_n_days(-10), du.get_n_days(-1)):
+        # print(i)
+        run(i)
 
 
 if __name__ == '__main__':
-    # run('2021-04-09')
+    # run('2021-04-07')
 
-    for i in du.getDateLists('2020-04-20','2021-04-08'):
+    for i in du.getDateLists('2021-04-01','2021-04-13'):
         print(i)
         run(i)