|
@@ -167,16 +167,16 @@ def get_channel_again_order_trend(channel,date,pitcher):
|
|
|
|
|
|
sql=f"""select toString(dt) date,
|
|
|
channel,book,
|
|
|
- round(cost,2) cost,
|
|
|
- round(reg_order_amount,2) reg_amount,
|
|
|
- round(if(cost=0,0,reg_order_amount/cost),4) roi,
|
|
|
+ toDecimal32(cost,2),
|
|
|
+ toDecimal32(reg_order_amount,2),
|
|
|
+ toDecimal32(if(cost=0,0,reg_order_amount/cost),4) roi,
|
|
|
follow_user new_follow,
|
|
|
- round(if(follow_user=0,0,cost/follow_user),2) new_follow_per_cost,
|
|
|
+ toDecimal32(if(follow_user=0,0,cost/follow_user),2) new_follow_per_cost,
|
|
|
reg_order_count reg_count,reg_order_user reg_user,
|
|
|
- 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,
|
|
|
- round(if(reg_order_user=0,0,order_count/reg_order_user),4) order_count
|
|
|
+ toDecimal32(if(reg_order_user=0,0,cost/reg_order_user),2) cost_per_user,
|
|
|
+ toDecimal32(if(reg_order_user=0,0,reg_order_amount/reg_order_user),2) avg_order_amount,
|
|
|
+ toDecimal32(if(reg_order_user=0,0,reg_order_user_again/reg_order_user),4) avg_again_order_rate,
|
|
|
+ if(reg_order_user=0,0,order_count/reg_order_user) order_count
|
|
|
|
|
|
from dw_daily_channel where channel='{channel}' and dt='{date}'
|
|
|
"""
|
|
@@ -328,7 +328,7 @@ def get_channel_active(channel,pitcher,start,end,page,page_size,order_by,order):
|
|
|
if get_channel_belong_pitcher(channel)!=pitcher:
|
|
|
return [],0
|
|
|
|
|
|
- sql=f"""select formatDateTime(a.dt,'%Y-%m-%d') date, '{channel}' channel,book,toDecimal32(cost,2),reg_amount,roi,new_follow_user,toDecimal32(new_follow_per_cost,2),order_user,order_count,
|
|
|
+ sql=f"""select formatDateTime(a.dt,'%Y-%m-%d') date, '{channel}' channel,book,toDecimal32(cost,2),toDecimal32(reg_amount,2),roi,new_follow_user,toDecimal32(new_follow_per_cost,2),order_user,order_count,
|
|
|
toDecimal32(order_user_per_cost,2),day7_avg_act_rate,toDecimal32(day7_avg_act_per_cost,2),day30_avg_act_rate,toDecimal32(ay30_avg_act_cost,2),
|
|
|
toDecimal32(act_per_cost,2),
|
|
|
concat(toString(reg_order_user1),',',toString(if(reg_order_user1=0,0,cost/reg_order_user1)),',',toString(if(order_user=0,0,reg_order_user1/order_user))),
|