|
@@ -467,6 +467,9 @@ def get_channel_order_trend(channel,pitcher,start,end,page,page_size,order_by,or
|
|
# channels = f' and channel in {get_channels_from_user(pitcher)} ' if pitcher != '赞象 admin' else ''
|
|
# channels = f' and channel in {get_channels_from_user(pitcher)} ' if pitcher != '赞象 admin' else ''
|
|
|
|
|
|
channel_op =f" and channel='{channel}' " if channel!='' else ''
|
|
channel_op =f" and channel='{channel}' " if channel!='' else ''
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
sql=f"""select pitcher,'{channel}' channel,toString(dt) date,book,toDecimal32(cost,2),toDecimal32(reg_order_amount,2),roi,new_follow_user,new_follow_per_cost,order_user,order_count,
|
|
sql=f"""select pitcher,'{channel}' channel,toString(dt) date,book,toDecimal32(cost,2),toDecimal32(reg_order_amount,2),roi,new_follow_user,new_follow_per_cost,order_user,order_count,
|
|
toDecimal32(order_user_per_cost,2),
|
|
toDecimal32(order_user_per_cost,2),
|
|
concat(toString(r1),',',toString(r1/cost),',', toString(a1/cost),',',toString(b1)),
|
|
concat(toString(r1),',',toString(r1/cost),',', toString(a1/cost),',',toString(b1)),
|
|
@@ -540,7 +543,7 @@ select pitcher,dt,book,cost,reg_order_amount,
|
|
if(follow_user=0,0,cost/follow_user) new_follow_per_cost,
|
|
if(follow_user=0,0,cost/follow_user) new_follow_per_cost,
|
|
reg_order_user order_user, reg_order_count order_count,
|
|
reg_order_user order_user, reg_order_count order_count,
|
|
if(reg_order_user=0,0,cost/reg_order_user) order_user_per_cost
|
|
if(reg_order_user=0,0,cost/reg_order_user) order_user_per_cost
|
|
- from dw_daily_channel where dt>='{start}' and dt<='{end}' {channel_op} and cost>0) a
|
|
|
|
|
|
+ from dw_daily_channel where dt>='{start}' and dt<='{end}' {channel_op} and pitcher='{pitcher}' and cost>0) a
|
|
|
|
|
|
left outer join (
|
|
left outer join (
|
|
select toDate(formatDateTime(reg_time,'%Y-%m-%d')) dt,
|
|
select toDate(formatDateTime(reg_time,'%Y-%m-%d')) dt,
|