ck 4 年之前
父节点
当前提交
a113604e28
共有 2 个文件被更改,包括 26 次插入6 次删除
  1. 22 1
      app/etl/data_stat_daily.py
  2. 4 5
      app/etl/data_stat_task.py

+ 22 - 1
app/etl/data_stat_daily.py

@@ -9,6 +9,7 @@ today = du.get_n_days(0)
 
 
 def run(ymd):
+
     try:
         # 公众号元数据
         channel_by_account_daily(ymd)
@@ -24,11 +25,31 @@ def run(ymd):
     except Exception as e:
         DingTalkUtils.send("数据ETL出错:",'18860455786')
 
+def run_order_history():
+    """当order表跑了历史的数据,要从这历史数据的最早时间跑此任务流"""
+    for i in du.getDateLists('2019-11-12',du.get_n_days(0)):
+        print(i)
+        ods_order(i)
+        order_sync_ck(i)
+    dw_daily_channel()
+    print('ok')
+
+
+def run_cost_history():
+    "cost 重跑后,跑此任务流"
+    for i in du.getDateLists('2019-03-18',du.get_n_days(0)):
+        print(i)
+        dw_daily_channel_cost(i)
+        dw_order_channel_cost_sync_ck(i)
+    dw_daily_channel()
+
+
 
 
 if __name__ == '__main__':
     run(yestoday)
-    dw_daily_channel()
+    # # dw_daily_channel()
+    # run_order_history()
 
 
 

+ 4 - 5
app/etl/data_stat_task.py

@@ -180,13 +180,12 @@ if __name__ == '__main__':
     # ods_order('2020-12-20')
     # dw_daily_channel_plus()
     # exit()
-    dw_daily_channel()
-    exit(0)
+    # dw_daily_channel()
+    # exit(0)
 
-    for i in dt.getDateLists('2019-03-18','2020-12-20'):
+    for i in dt.getDateLists('2019-03-18','2020-12-21'):
         print(i)
-        # ods_order(i)
-        # channel_by_account_daily(i)
+        ods_order(i)
         # channel_info_daily(i)
         dw_daily_channel_cost(i)
         dw_order_channel_cost_sync_ck(i)