|
@@ -143,7 +143,12 @@ def get_channel_overview(channel,pitcher,start,end,page,page_size,order_by,order
|
|
|
reg_order_user_again,
|
|
|
reg_order_user,
|
|
|
round(if(reg_order_user=0,0,reg_order_user_again/reg_order_user),4) old_user_once_order_rate,
|
|
|
- pitcher,stage from dw_channel_daily where 1=1 {op1} {op2} {op3} {op4} {op5} """
|
|
|
+ pitcher,stage,
|
|
|
+ round(cost/first_order_user,2) first_order_user_per_cost,
|
|
|
+ round(reg_order_amount/reg_order_user,2) user_per_amount,
|
|
|
+ round(click_count/follow_user,4) click_follow_rate,
|
|
|
+ round(reg_order_user/follow_user,4) follow_order_rate
|
|
|
+from dw_channel_daily where 1=1 {op1} {op2} {op3} {op4} {op5} """
|
|
|
|
|
|
print(sql)
|
|
|
sumsql=f"""select '总计' date,
|
|
@@ -170,7 +175,13 @@ round(sum(first_order_user)/sum(follow_user),4) new_user_order_rate,
|
|
|
sum(reg_order_amount) reg_order_amount,
|
|
|
round(sum(first_order_amount)/sum(cost),4) day_roi,
|
|
|
round(sum(reg_order_amount)/sum(cost),4) roi,
|
|
|
-round(sum(reg_order_user_again)/sum(reg_order_user),4) old_user_once_order_rate
|
|
|
+round(sum(reg_order_user_again)/sum(reg_order_user),4) old_user_once_order_rate,
|
|
|
+ round(sum(cost)/sum(first_order_user),2) first_order_user_per_cost,
|
|
|
+ round(sum(reg_order_amount)/sum(reg_order_user),2) user_per_amount,
|
|
|
+ round(sum(click_count)/sum(follow_user),4) click_follow_rate,
|
|
|
+ round(sum(reg_order_user)/sum(follow_user),4) follow_order_rate
|
|
|
+
|
|
|
+
|
|
|
from ({sql}) a
|
|
|
|
|
|
"""
|