ck 4 gadi atpakaļ
vecāks
revīzija
23a1d2e918
2 mainītis faili ar 6 papildinājumiem un 8 dzēšanām
  1. 5 7
      data_manage/pitcher_panel.py
  2. 1 1
      urls.py

+ 5 - 7
data_manage/pitcher_panel.py

@@ -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)

+ 1 - 1
urls.py

@@ -4,7 +4,7 @@ from handlers.GitHookHandler import *
 
 
 urls = [
-    (r'/data/pitcher_panel/channel', PitcherPanelChannel),  # 公众号汇总
+    # (r'/data/pitcher_panel/channel', PitcherPanelChannel),  # 公众号汇总
     (r'/data/pitcher_panel/daily', PitcherPanelDaily), # 日期汇总
     (r'/data/pitcher_panel/overview', PitcherPanelOverview), # 投手今天概况
     (r'/data/channel_stat/overview',ChannelOverview), # 公众号广告投放数据