|
@@ -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,
|
|
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(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(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(ad_product_cnt) ad_product_cnt,
|
|
sum(event_goods_view) event_goods_view,
|
|
sum(event_goods_view) event_goods_view,
|
|
sum(merchant_reco_fans) merchant_reco_fans,
|
|
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(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,
|
|
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
|
|
sum(event_ad_watch_times) event_ad_watch_times
|
|
|
|
+
|
|
from
|
|
from
|
|
media_api.kuaishou_campaign_report_daily a
|
|
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 >= 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
|
|
cua.account_id IS NOT NULL) bei
|
|
ON report.account_id = bei.account_id;
|
|
ON report.account_id = bei.account_id;
|
|
""".format(date_time=self.date_time, day_count=self.day_count)
|
|
""".format(date_time=self.date_time, day_count=self.day_count)
|
|
|
|
+ print(sql)
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
TidbConn.upsert(conn=self.conn, sql_buff=sql)
|
|
self.conn.commit()
|
|
self.conn.commit()
|
|
TidbConn.conn_close(conn=self.conn)
|
|
TidbConn.conn_close(conn=self.conn)
|