|
@@ -143,12 +143,12 @@ def get_channel_overview(channel,pitcher,start,end,page,page_size,order_by,order
|
|
reg_order_user_again,
|
|
reg_order_user_again,
|
|
reg_order_user,
|
|
reg_order_user,
|
|
round(if(reg_order_user=0,0,reg_order_user_again/reg_order_user),4) old_user_once_order_rate,
|
|
round(if(reg_order_user=0,0,reg_order_user_again/reg_order_user),4) old_user_once_order_rate,
|
|
- pitcher,stage,book,
|
|
|
|
|
|
+ pitcher,stage,book,type,
|
|
round(cost/first_order_user,2) first_order_user_per_cost,
|
|
round(cost/first_order_user,2) first_order_user_per_cost,
|
|
round(reg_order_amount/reg_order_user,2) user_per_amount,
|
|
round(reg_order_amount/reg_order_user,2) user_per_amount,
|
|
round(follow_user/click_count,4) click_follow_rate,
|
|
round(follow_user/click_count,4) click_follow_rate,
|
|
round(reg_order_user/follow_user,4) follow_order_rate
|
|
round(reg_order_user/follow_user,4) follow_order_rate
|
|
-from dw_channel_daily where 1=1 {op1} {op2} {op3} {op4} {op5} """
|
|
|
|
|
|
+from dw_channel where 1=1 {op1} {op2} {op3} {op4} {op5} """
|
|
|
|
|
|
print(sql)
|
|
print(sql)
|
|
sumsql=f"""select '总计' date,
|
|
sumsql=f"""select '总计' date,
|
|
@@ -369,7 +369,7 @@ def get_channel_active(channel,pitcher,start,end,page,page_size,order_by,order):
|
|
|
|
|
|
|
|
|
|
sql=f"""
|
|
sql=f"""
|
|
- select channel,dt date,book,stage,cost,
|
|
|
|
|
|
+ select channel,dt date,book,stage,pitcher,cost,
|
|
reg_order_amount reg_amount,
|
|
reg_order_amount reg_amount,
|
|
dc7,dc30,
|
|
dc7,dc30,
|
|
round(reg_order_amount/cost,4) roi,
|
|
round(reg_order_amount/cost,4) roi,
|
|
@@ -524,7 +524,7 @@ concat(da60-da59 ,',' ,da60/cost ,',', (da60-da59)/cost ,',' ,da60/da1) d60,
|
|
concat(dm3-da60 ,',' ,dm3/cost ,',', (dm3-da60)/cost ,',' ,dm3/da1) m3,
|
|
concat(dm3-da60 ,',' ,dm3/cost ,',', (dm3-da60)/cost ,',' ,dm3/da1) m3,
|
|
concat(dm4-dm3 ,',' ,dm4/cost ,',', (dm4-dm3)/cost ,',' ,dm4/da1) m4,
|
|
concat(dm4-dm3 ,',' ,dm4/cost ,',', (dm4-dm3)/cost ,',' ,dm4/da1) m4,
|
|
concat(dm5-dm4 ,',' ,dm5/cost ,',', (dm5-dm4)/cost ,',' ,dm5/da1) m5
|
|
concat(dm5-dm4 ,',' ,dm5/cost ,',', (dm5-dm4)/cost ,',' ,dm5/da1) m5
|
|
-from ( select * from dw_channel where 1=1 {op1} {op2} {op3} {op4} ) a
|
|
|
|
|
|
+from ( select * from dw_channel where cost+reg_order_amount>0 {op1} {op2} {op3} {op4} ) a
|
|
left join dw_channel_amount_daily b on a.channel=b.channel and a.dt=b.dt
|
|
left join dw_channel_amount_daily b on a.channel=b.channel and a.dt=b.dt
|
|
{op5}
|
|
{op5}
|
|
"""
|
|
"""
|