浏览代码

修改时间

zhl 3 年之前
父节点
当前提交
fb105bc7b5

+ 1 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouAccountReportBusi.py

@@ -296,7 +296,7 @@ ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outb
 sum(event_ad_watch_times) event_ad_watch_times
 from 
  media_api.kuaishou_account_report_daily a 
-  where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count} -1  DAY),'%Y%m%d')
+  where stat_date between date_format(date_sub({date_time}, INTERVAL {day_count} -1  DAY),'%Y%m%d') and {date_time}
  group by advertiser_id) report
 LEFT JOIN (
 SELECT

+ 2 - 2
Apietl/kwai_etl/Q4Task/AppKuaishouAccountReportBusiMonth.py

@@ -294,8 +294,8 @@ ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outb
 sum(event_ad_watch_times) event_ad_watch_times
 from 
  media_api.kuaishou_account_report_daily a  
-where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d')
- group by advertiser_id) report
+ where stat_date between  date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d') and {date_time}
+group by advertiser_id) report
 LEFT JOIN (
 SELECT
 cua.account_id id,

+ 1 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouCampaignReportBusi.py

@@ -300,7 +300,7 @@ ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outb
 sum(event_ad_watch_times) event_ad_watch_times
 from 
  media_api.kuaishou_campaign_report_daily  a  
- where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count} -1  DAY),'%Y%m%d')
+ where stat_date between date_format(date_sub({date_time}, INTERVAL {day_count} -1  DAY),'%Y%m%d') and {date_time}
  group by advertiser_id,campaign_id,campaign_name) report
 LEFT JOIN (
 SELECT

+ 1 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouCampaignReportBusiMonth.py

@@ -298,7 +298,7 @@ ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outb
 sum(event_ad_watch_times) event_ad_watch_times
 from 
  media_api.kuaishou_campaign_report_daily  a  
- where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d')
+ where stat_date between  date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d') and {date_time}
  group by advertiser_id,campaign_id,campaign_name) report
 LEFT JOIN (
 SELECT

+ 2 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouCompanyDesignReportBusi.py

@@ -445,7 +445,8 @@ report.`show`,
     report.event_outbound_call_ratio,
     report.event_ad_watch_times
     FROM
-     (select * from media_api.kuaishou_material_video_report_daily where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count}-1 DAY),'%Y%m%d')) report
+     (select * from media_api.kuaishou_material_video_report_daily 
+     where stat_date between date_format(date_sub({date_time}, INTERVAL {day_count}-1 DAY),'%Y%m%d') and {date_time}) report
      LEFT JOIN
 (select account_id,signature,photo_id from media_api.kuaishou_video_list  group by account_id,signature,photo_id) video
 ON report.advertiser_id = video.account_id AND report.photo_id = video.photo_id

+ 1 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouCompanyDesignReportBusiMonth.py

@@ -311,7 +311,7 @@ report.charge ,
     report.event_ad_watch_times
 FROM
 (select * from media_api.kuaishou_material_video_report_daily 
-where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d')
+where stat_date between date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d') and {date_time}
 ) report
 LEFT JOIN 
 (select account_id,signature,photo_id from media_api.kuaishou_video_list  group by account_id,signature,photo_id) video 

+ 1 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouCompanyUserReportBusi.py

@@ -449,7 +449,7 @@ report.`show`,
     report.event_ad_watch_times
    from
    (select * from  media_api.kuaishou_account_report_daily  
-   where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count}-1 DAY),'%Y%m%d')) report
+   where stat_date between date_format(date_sub({date_time}, INTERVAL {day_count}-1 DAY),'%Y%m%d') and {date_time}) report
    left join
    (
 SELECT

+ 1 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouCompanyUserReportBusiMonth.py

@@ -310,7 +310,7 @@ report.charge ,
     report.event_ad_watch_times
    from  
    (select * from  media_api.kuaishou_account_report_daily 
-    where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d')
+    where stat_date between date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d') and {date_time}
     ) report
    left join 
    (

+ 2 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouProductReportBusi.py

@@ -294,7 +294,8 @@ round(sum(ad_photo_played_2s_ratio)/{day_count}*100,3) ad_photo_played_2s_ratio,
 round(sum(event_outbound_call_ratio)/sum(activation)*100,3) event_outbound_call_ratio,
 sum(event_ad_watch_times) event_ad_watch_times
 from
-(select * from media_api.kuaishou_account_report_daily where stat_date>=date_format(date_sub({date_time},INTERVAL {day_count}-1 DAY),'%Y%m%d')) report
+(select * from media_api.kuaishou_account_report_daily 
+where stat_date between date_format(date_sub({date_time},INTERVAL {day_count}-1 DAY),'%Y%m%d') and {date_time}) report
 LEFT JOIN`jeecg-boot`.ctop_user_allocation cua ON report.advertiser_id=cua.account_id
 LEFT JOIN`jeecg-boot`.ctop_project cp ON cua.project_id=cp.id
 LEFT JOIN`jeecg-boot`.ctop_product cn ON cp.product_id=cn.id

+ 1 - 2
Apietl/kwai_etl/Q4Task/AppKuaishouProductReportBusiMonth.py

@@ -160,8 +160,7 @@ ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outb
 sum(event_ad_watch_times) event_ad_watch_times
  from  
  (select * from  media_api.kuaishou_account_report_daily  
- where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d')
- ) report
+ where stat_date between  date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d') and {date_time}) report
 LEFT JOIN `jeecg-boot`.ctop_user_allocation cua ON report.advertiser_id = cua.account_id
 LEFT JOIN `jeecg-boot`.ctop_project cp ON cua.project_id = cp.id
 LEFT JOIN `jeecg-boot`.ctop_product cn ON cp.product_id = cn.id

+ 2 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouProjectReportBusi.py

@@ -298,7 +298,8 @@ round(sum(ad_photo_played_2s_ratio)/{day_count}*100,3) ad_photo_played_2s_ratio,
 round(sum(event_outbound_call_ratio)/sum(activation)*100,3) event_outbound_call_ratio,
 sum(event_ad_watch_times) event_ad_watch_times
 from
-(select * from media_api.kuaishou_account_report_daily where stat_date>=date_format(date_sub({date_time},INTERVAL {day_count}-1 DAY),'%Y%m%d')) report
+(select * from media_api.kuaishou_account_report_daily 
+where stat_date between date_format(date_sub({date_time},INTERVAL {day_count}-1 DAY),'%Y%m%d') and {date_time}) report
 LEFT JOIN`jeecg-boot`.ctop_user_allocation cua ON report.advertiser_id=cua.account_id
 LEFT JOIN`jeecg-boot`.ctop_project cp ON cua.project_id=cp.id
 LEFT JOIN`jeecg-boot`.ctop_product cn ON cp.product_id=cn.id

+ 1 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouProjectReportBusiMonth.py

@@ -162,7 +162,7 @@ ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outb
 sum(event_ad_watch_times) event_ad_watch_times
  from  
  (select * from  media_api.kuaishou_account_report_daily  
- where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d')
+ where stat_date between date_format(date_sub({date_time}, INTERVAL {day_count} DAY),'%Y%m%d') and {date_time}
  ) report
 LEFT JOIN `jeecg-boot`.ctop_user_allocation cua ON report.advertiser_id = cua.account_id
 LEFT JOIN `jeecg-boot`.ctop_project cp ON cua.project_id = cp.id

+ 1 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouUnitReportBusi.py

@@ -308,7 +308,7 @@ ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outb
 sum(event_ad_watch_times) event_ad_watch_times
 from 
  media_api.kuaishou_unit_report_daily  a 
-where stat_date >= date_format(date_sub({date_time}, INTERVAL ({day_count} -1 ) DAY),'%Y%m%d')
+where stat_date between date_format(date_sub({date_time}, INTERVAL ({day_count} -1 ) DAY),'%Y%m%d') and {date_time}
 and advertiser_id={account_id}
  group by advertiser_id,campaign_id,campaign_name,unit_id,unit_name) report
 LEFT JOIN (

+ 1 - 1
Apietl/kwai_etl/Q4Task/AppKuaishouUnitReportBusiMonth.py

@@ -306,7 +306,7 @@ ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outb
 sum(event_ad_watch_times) event_ad_watch_times
 from 
  media_api.kuaishou_unit_report_daily  a 
-where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count}  DAY),'%Y%m%d')
+where stat_date between date_format(date_sub({date_time}, INTERVAL {day_count}  DAY),'%Y%m%d') and {date_time}
 and advertiser_id={account_id}
  group by advertiser_id,campaign_id,campaign_name,unit_id,unit_name) report
 LEFT JOIN (

+ 2 - 2
Apietl/kwai_etl/Q4Task/AppKuaishouVideoReportBusi.py

@@ -22,7 +22,7 @@ class AppKuaishouVideoReportBusi:
     def taskHandler(self):
         try:
             sql_porject = """select advertiser_id from media_api.kuaishou_material_video_report_daily 
-where  stat_date >= date_format(date_sub({date_time}, INTERVAL ({day_count} -1 )  DAY),'%Y%m%d')
+where  stat_date between date_format(date_sub({date_time}, INTERVAL ({day_count} -1 )  DAY),'%Y%m%d')  and {date_time}
 group by advertiser_id """.format(date_time=self.date_time,day_count=self.day_count)
             account_list = TidbConn.quary(self.conn, sql_porject)
             for account_id in account_list:
@@ -323,7 +323,7 @@ ifnull(round(sum(ad_photo_played_2s_ratio)/{day_count}*100,3),0) ad_photo_played
 ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outbound_call_ratio,
 sum(event_ad_watch_times) event_ad_watch_times
 from  media_api.kuaishou_material_video_report_daily 
-where  stat_date >= date_format(date_sub({date_time}, INTERVAL ({day_count} -1 )  DAY),'%Y%m%d')
+where  stat_date between date_format(date_sub({date_time}, INTERVAL ({day_count} -1 )  DAY),'%Y%m%d') and {date_time}
 and advertiser_id={account_id}
 group by 
 advertiser_id,

+ 2 - 2
Apietl/kwai_etl/Q4Task/AppKuaishouVideoReportBusiMonth.py

@@ -22,7 +22,7 @@ class AppKuaishouVideoReportBusiMonth:
     def taskHandler(self):
         try:
             sql_porject = """select advertiser_id from media_api.kuaishou_material_video_report_daily 
-            where  stat_date >= date_format(date_sub({date_time}, INTERVAL ({day_count})  DAY),'%Y%m%d')
+            where  stat_date between date_format(date_sub({date_time}, INTERVAL ({day_count})  DAY),'%Y%m%d') and {date_time}
             group by advertiser_id """.format(date_time=self.date_time,day_count=self.day_count)
             account_list = TidbConn.quary(self.conn, sql_porject)
             for account_id in account_list:
@@ -321,7 +321,7 @@ ifnull(round(sum(ad_photo_played_2s_ratio)/{day_count}*100,3),0) ad_photo_played
 ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outbound_call_ratio,
 sum(event_ad_watch_times) event_ad_watch_times
 from  media_api.kuaishou_material_video_report_daily 
-where  stat_date >= date_format(date_sub({date_time}, INTERVAL ({day_count})  DAY),'%Y%m%d')
+where  stat_date between  date_format(date_sub({date_time}, INTERVAL ({day_count})  DAY),'%Y%m%d') and {date_time}
 and advertiser_id={account_id}
 group by 
 advertiser_id,