|
@@ -54,14 +54,12 @@ def get_pitcher_panel_daily(pitcher, start, end, page, page_size, order_by, orde
|
|
|
sql=f"""
|
|
|
select dt date,
|
|
|
pitcher,cost,
|
|
|
- first_reg_amount first_order_amount,reg_amount,
|
|
|
+ first_reg_amount first_order_amount,
|
|
|
+ reg_amount,
|
|
|
round(if(cost=0,0,first_reg_amount/cost),4) first_roi,
|
|
|
amount order_amount,
|
|
|
round(if(cost=0,0,reg_amount/cost),4) today_roi,
|
|
|
- total_amount,
|
|
|
- total_cost,
|
|
|
- total_amount-total_cost total_profit,
|
|
|
- if(total_cost=0,0,total_amount/total_cost) total_roi
|
|
|
+ reg_amount-cost profit
|
|
|
from dw_pitcher_daily where 1=1 {op1} {op2} {op3} {op4}
|
|
|
"""
|
|
|
print(sql)
|
|
@@ -71,8 +69,8 @@ def get_pitcher_panel_daily(pitcher, start, end, page, page_size, order_by, orde
|
|
|
sum(first_order_amount) first_order_amount,sum(reg_amount) reg_amount,
|
|
|
round(if(sum(cost)=0,0,sum(first_order_amount)/sum(cost)),4) first_roi,
|
|
|
sum(order_amount) order_amount,
|
|
|
- round(if(sum(cost)=0,0,sum(reg_amount)/sum(cost)),4) today_roi
|
|
|
-
|
|
|
+ round(if(sum(cost)=0,0,sum(reg_amount)/sum(cost)),4) today_roi,
|
|
|
+ sum(profit) profit
|
|
|
from ({sql}) b """
|
|
|
|
|
|
print(sumSql)
|