|
@@ -749,15 +749,16 @@ def get_channel_summary(channel,pitcher,page,page_size,order_by,order,state):
|
|
|
|
|
|
|
|
|
|
|
|
- sql = f"""select a.channel channel,state,'朋友圈' location,toString(a.start) start,toString(a.end) end,
|
|
|
+ sql = f"""select a.channel channel,state,type location,toString(a.start) start,toString(a.end) end,
|
|
|
toDecimal32(total_cost,2),toDecimal32(total_amount,2),
|
|
|
toDecimal32(profit,2),roi,follow_user,toDecimal32(follow_per_cost,2),order_user,
|
|
|
if(follow_user=0,0,order_user/follow_user) order_tran_rate,toDecimal32(if(order_user=0,0,total_cost/order_user),2) order_tran_cost,
|
|
|
pitcher
|
|
|
from
|
|
|
(
|
|
|
- select channel,if(max(dt)>subtractDays(today(),10),'在投','停投') state,
|
|
|
- min(if(cost>0,dt,null)) start,max(if(cost>0,dt,null) ) end
|
|
|
+ select channel,
|
|
|
+ min(if(cost>0,dt,null)) start,max(if(cost>0,dt,null) ) end,
|
|
|
+ if(end>subtractDays(today(),10),'在投','停投') state,type
|
|
|
from dw_daily_channel_cost where 1=1 {pitcher_op} {channel_op} group by channel) a
|
|
|
|
|
|
left outer join(
|