|
@@ -146,13 +146,13 @@ def get_channel_again_order_trend(channel,date):
|
|
channel,book,
|
|
channel,book,
|
|
round(cost,2) cost,
|
|
round(cost,2) cost,
|
|
round(reg_order_amount,2) reg_amount,
|
|
round(reg_order_amount,2) reg_amount,
|
|
- round(reg_order_amount/cost,4) roi,
|
|
|
|
|
|
+ round(if(cost=0,0,reg_order_amount/cost),4) roi,
|
|
follow_user new_follow,
|
|
follow_user new_follow,
|
|
- round(cost/follow_user,2) new_follow_per_cost,
|
|
|
|
|
|
+ round(if(follow_user=0,0,cost/follow_user),2) new_follow_per_cost,
|
|
reg_order_count reg_count,reg_order_user reg_user,
|
|
reg_order_count reg_count,reg_order_user reg_user,
|
|
- round(cost/reg_order_user,2) cost_per_user,
|
|
|
|
- round(reg_order_amount/reg_order_user,2) avg_order_amount,
|
|
|
|
- round(reg_order_user_again/reg_order_user,4) avg_again_order_rate,
|
|
|
|
|
|
+ round(if(reg_order_user=0,0,cost/reg_order_user),2) cost_per_user,
|
|
|
|
+ round(if(reg_order_user=0,0,reg_order_amount/reg_order_user),2) avg_order_amount,
|
|
|
|
+ round(if(reg_order_user=0,0,reg_order_user_again/reg_order_user),4) avg_again_order_rate,
|
|
order_count
|
|
order_count
|
|
|
|
|
|
from dw_daily_channel where channel='{channel}' and dt='{date}'
|
|
from dw_daily_channel where channel='{channel}' and dt='{date}'
|