浏览代码

MOD:ad_cost_day 修改

cxyu 3 年之前
父节点
当前提交
4f81e7735f
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7 5
      app/etl/dw/dw_image_cost_day.py

+ 7 - 5
app/etl/dw/dw_image_cost_day.py

@@ -157,7 +157,7 @@ def run(dt):
             left join channel_info_daily f on e.channel=f.channel and e.dt=f.dt
             left join video_info g on c.image_id=g.video_id
             left join campaign_info h on a.campaign_id = h.campaign_id 
-            where a.dt='{dt}'  and c.is_video=1 and h.campaign_id  is not null
+            where a.dt='{dt}'  and c.is_video=1 and a.campaign_id  is not null
             group by a.campaign_id) as foo
             left join
             (select signature,pitcher from ad_cost_day a 
@@ -167,7 +167,7 @@ def run(dt):
             left join channel_info_daily f on e.channel=f.channel and e.dt=f.dt
             left join video_info g on c.image_id=g.video_id
             left join campaign_info h on a.campaign_id = h.campaign_id 
-            where a.dt='{dt}'  and c.is_video=1 and h.campaign_id  is not null
+            where a.dt='{dt}'  and c.is_video=1 and a.campaign_id  is not null
             and (signature,h.created_time) in 
             (select signature,min(h.created_time) as created_time  
             from 
@@ -178,7 +178,7 @@ def run(dt):
             left join channel_info_daily f on e.channel=f.channel and e.dt=f.dt
             left join video_info g on c.image_id=g.video_id
             left join campaign_info h on a.campaign_id = h.campaign_id 
-            where a.dt='{dt}'  and c.is_video=1 and h.campaign_id  is not null
+            where a.dt='{dt}'  and c.is_video=1 and a.campaign_id  is not null
             and length (signature)>6
             group by signature)
             group by signature ,pitcher ) as foo2 
@@ -264,11 +264,13 @@ if __name__ == '__main__':
     )
     # -495
     #
-    for i in du.getDateLists(du.get_n_days(-360), du.get_n_days(0)):
+    for i in du.getDateLists(du.get_n_days(-365), du.get_n_days(0)):
         print(i)
+        # exit()
         run(i)
 
     # print(du.get_n_days(-20))
     # run(du.get_n_days(0))
     # print(du.get_n_days(-30))
-    run(du.get_n_days(-3))
+    # print(du.get_n_days(-3))
+    # run(du.get_n_days(-3))