|
@@ -449,9 +449,8 @@ def get_channel_order_trend(channel,pitcher,start,end,page,page_size,order_by,or
|
|
|
op5 = f" order by {order_by} {order}" if order_by and order else ''
|
|
|
|
|
|
sql=f"""select stage,pitcher,a.channel,a.dt date,book,
|
|
|
- 0 require_roi,0 require_mult,
|
|
|
--- round(r1*require_mult-cost,2) expect_profit,
|
|
|
- 0 expect_profit,
|
|
|
+ node/100 require_roi,round(100/node,2) require_mult,
|
|
|
+ round(first_order_amount*100/node-cost,2) expect_profit,
|
|
|
cost,
|
|
|
first_order_amount first_amount,
|
|
|
reg_order_amount reg_amount,
|
|
@@ -527,7 +526,9 @@ concat(dm3-da60 ,',' ,dm3/cost ,',', (dm3-da60)/cost ,',' ,dm3/da1) m3,
|
|
|
concat(dm4-dm3 ,',' ,dm4/cost ,',', (dm4-dm3)/cost ,',' ,dm4/da1) m4,
|
|
|
concat(dm5-dm4 ,',' ,dm5/cost ,',', (dm5-dm4)/cost ,',' ,dm5/da1) m5
|
|
|
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
|
|
|
+left join src_book_info c using(book,platform,type)
|
|
|
+
|
|
|
{op5}
|
|
|
"""
|
|
|
|