renyupeng 3 yıl önce
ebeveyn
işleme
ef1f13bca3

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

@@ -235,7 +235,7 @@ ifnull(round(sum(play_end_ratio)/{day_count}*100,3),0) play_end_ratio,
 sum(event_new_user_pay) event_new_user_pay,
 ifnull(round(sum(charge)/sum(event_new_user_pay),3),0) event_new_user_pay_cost,
 ifnull(round(sum(event_new_user_pay)/sum(activation)*100,3),0) event_new_user_pay_ratio,
-ifnull(round(sum(click_1k_cost)/{day_count}*100),3),0) click_1k_cost,
+ifnull(round(sum(click_1k_cost)/{day_count}*100,3),0) click_1k_cost,
 sum(ad_product_cnt) ad_product_cnt,
 sum(event_goods_view) event_goods_view,
 sum(merchant_reco_fans) merchant_reco_fans,
@@ -323,6 +323,7 @@ WHERE
 cua.account_id IS NOT NULL) bei 
 ON report.account_id = bei.account_id;
             """.format(date_time=self.date_time, day_count=self.day_count)
+            print(sql)
             TidbConn.upsert(conn=self.conn, sql_buff=sql)
             self.conn.commit()
             TidbConn.conn_close(conn=self.conn)

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

@@ -239,7 +239,7 @@ ifnull(round(sum(play_end_ratio)/{day_count}*100,3),0) play_end_ratio,
 sum(event_new_user_pay) event_new_user_pay,
 ifnull(round(sum(charge)/sum(event_new_user_pay),3),0) event_new_user_pay_cost,
 ifnull(round(sum(event_new_user_pay)/sum(activation)*100,3),0) event_new_user_pay_ratio,
-ifnull(round(sum(click_1k_cost)/{day_count}*100),3),0) click_1k_cost,
+ifnull(round(sum(click_1k_cost)/{day_count}*100,3),0) click_1k_cost,
 sum(ad_product_cnt) ad_product_cnt,
 sum(event_goods_view) event_goods_view,
 sum(merchant_reco_fans) merchant_reco_fans,
@@ -296,6 +296,7 @@ sum(event_measurement_house) event_measurement_house,
 ifnull(round(sum(ad_photo_played_2s_ratio)/{day_count}*100,3),0) ad_photo_played_2s_ratio,
 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_campaign_report_daily  a  
  where stat_date >= date_format(date_sub({date_time}, INTERVAL {day_count} -1  DAY),'%Y%m%d')
@@ -327,6 +328,7 @@ WHERE
 cua.account_id IS NOT NULL) bei 
 ON report.account_id = bei.account_id;
 """.format(date_time=self.date_time, day_count=self.day_count)
+            print(sql)
             TidbConn.upsert(conn=self.conn, sql_buff=sql)
             self.conn.commit()
             TidbConn.conn_close(conn=self.conn)

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

@@ -239,7 +239,7 @@ ifnull(round(sum(play_end_ratio)/{day_count}*100,3),0) play_end_ratio,
 sum(event_new_user_pay) event_new_user_pay,
 ifnull(round(sum(charge)/sum(event_new_user_pay),3),0) event_new_user_pay_cost,
 ifnull(round(sum(event_new_user_pay)/sum(activation)*100,3),0) event_new_user_pay_ratio,
-ifnull(round(sum(click_1k_cost)/{day_count}*100),3),0) click_1k_cost,
+ifnull(round(sum(click_1k_cost)/{day_count}*100,3),0) click_1k_cost,
 sum(ad_product_cnt) ad_product_cnt,
 sum(event_goods_view) event_goods_view,
 sum(merchant_reco_fans) merchant_reco_fans,
@@ -327,6 +327,7 @@ WHERE
 cua.account_id IS NOT NULL) bei 
 ON report.account_id = bei.account_id;
 """.format(date_time=self.date_time, day_count=self.day_count)
+            print(sql)
             TidbConn.upsert(conn=self.conn, sql_buff=sql)
             self.conn.commit()
             TidbConn.conn_close(conn=self.conn)

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

@@ -159,7 +159,8 @@ ifnull(round(sum(event_multi_conversion)/sum(activation)*100,3),0)  event_multi_
 sum(event_measurement_house) event_measurement_house,
 ifnull(round(sum(ad_photo_played_2s_ratio)/{day_count}*100,3),0) ad_photo_played_2s_ratio,
 ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outbound_call_ratio,
-sum(event_ad_watch_times) event_ad_watch_timesfrom 
+sum(event_ad_watch_times) event_ad_watch_times
+from
 (SELECT
 video.signature,
 uc.company_id,
@@ -355,6 +356,7 @@ group by
   leader_id
 ;
             """.format(date_time=self.date_time, day_count=self.day_count)
+            print(sql)
             TidbConn.upsert(conn=self.conn, sql_buff=sql)
             self.conn.commit()
             TidbConn.conn_close(conn=self.conn)

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

@@ -160,7 +160,8 @@ ifnull(round(sum(event_multi_conversion)/sum(activation)*100,3),0)  event_multi_
 sum(event_measurement_house) event_measurement_house,
 ifnull(round(sum(ad_photo_played_2s_ratio)/{day_count}*100,3),0) ad_photo_played_2s_ratio,
 ifnull(round(sum(event_outbound_call_ratio)/sum(activation)*100,3),0) event_outbound_call_ratio,
-sum(event_ad_watch_times) event_ad_watch_timesfrom 
+sum(event_ad_watch_times) event_ad_watch_times
+from 
 (SELECT
 video.signature,
 uc.company_id,

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

@@ -342,6 +342,7 @@ group by
 
 
             """.format(date_time=self.date_time, day_count=self.day_count)
+            print(sql)
             TidbConn.upsert(conn=self.conn, sql_buff=sql)
             self.conn.commit()
             TidbConn.conn_close(conn=self.conn)

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

@@ -167,8 +167,9 @@ 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
 LEFT JOIN `jeecg-boot`.user_company uc ON uc.user_id = cua.user_id
 GROUP BY
-cua.product_id;
+cp.product_id;
             """.format(date_time=self.date_time, day_count=self.day_count)
+            print(sql)
             TidbConn.upsert(conn=self.conn, sql_buff=sql)
             self.conn.commit()
             TidbConn.conn_close(conn=self.conn)

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

@@ -167,7 +167,7 @@ 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
 LEFT JOIN `jeecg-boot`.user_company uc ON uc.user_id = cua.user_id
 GROUP BY
-cua.product_id;
+cp.product_id;
             """.format(date_time=self.date_time, day_count=self.day_count)
             TidbConn.upsert(conn=self.conn, sql_buff=sql)
             self.conn.commit()

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

@@ -247,7 +247,7 @@ ifnull(round(sum(play_end_ratio)/{day_count}*100,3),0) play_end_ratio,
 sum(event_new_user_pay) event_new_user_pay,
 ifnull(round(sum(charge)/sum(event_new_user_pay),3),0) event_new_user_pay_cost,
 ifnull(round(sum(event_new_user_pay)/sum(activation)*100,3),0) event_new_user_pay_ratio,
-ifnull(round(sum(click_1k_cost)/{day_count}*100),3),0) click_1k_cost,
+ifnull(round(sum(click_1k_cost)/{day_count}*100,3),0) click_1k_cost,
 sum(ad_product_cnt) ad_product_cnt,
 sum(event_goods_view) event_goods_view,
 sum(merchant_reco_fans) merchant_reco_fans,

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

@@ -247,7 +247,7 @@ ifnull(round(sum(play_end_ratio)/{day_count}*100,3),0) play_end_ratio,
 sum(event_new_user_pay) event_new_user_pay,
 ifnull(round(sum(charge)/sum(event_new_user_pay),3),0) event_new_user_pay_cost,
 ifnull(round(sum(event_new_user_pay)/sum(activation)*100,3),0) event_new_user_pay_ratio,
-ifnull(round(sum(click_1k_cost)/{day_count}*100),3),0) click_1k_cost,
+ifnull(round(sum(click_1k_cost)/{day_count}*100,3),0) click_1k_cost,
 sum(ad_product_cnt) ad_product_cnt,
 sum(event_goods_view) event_goods_view,
 sum(merchant_reco_fans) merchant_reco_fans,