Browse Source

整体概况添加channel搜索

ck 4 years ago
parent
commit
8ebaf998aa
2 changed files with 7 additions and 5 deletions
  1. 5 4
      data_manage/public_analysis.py
  2. 2 1
      handlers/PublicAnalysisHandler.py

+ 5 - 4
data_manage/public_analysis.py

@@ -386,7 +386,7 @@ def pitcher_overview(user_id,start, end, pitcher, page, page_size, order_by, ord
 
 
 
-def boss_panel_summary(user_id,start,end,pitcher, type, stage, page, page_size, order_by, order):
+def boss_panel_summary(user_id,start,end,channel,pitcher, type, stage, page, page_size, order_by, order):
 
     if user_id in super_auth():
         op = ''
@@ -401,13 +401,14 @@ def boss_panel_summary(user_id,start,end,pitcher, type, stage, page, page_size,
     op3 = f" and dt<='{end}' " if end else ''
     op4 = f" and type='{type}' " if type else ''
     op5= f" and stage='{stage}' " if stage else ''
-    op6 = f" order by {order_by} {order}" if order_by and order else 'order by dt desc'
+    op6 = f" and channel='{channel}' " if stage else ''
+    op7 = f" order by {order_by} {order}" if order_by and order else 'order by dt desc'
 
     dm = MysqlUtils().dm
 
     sql=f"""select sum(order_amount) order_amount,sum(cost) cost,dt from dw_channel                                                                                                                                                                                                                                                                                                                                             
-    where 1=1 {op} {op1} {op2} {op3} {op4} {op5}
-    GROUP BY dt HAVING order_amount+cost>0 {op6} """
+    where 1=1 {op} {op1} {op2} {op3} {op4} {op5} {op6}
+    GROUP BY dt HAVING order_amount+cost>0 {op7} """
     # print(sql)
 
     return getLimitData(dm, sql, page, page_size)

+ 2 - 1
handlers/PublicAnalysisHandler.py

@@ -119,9 +119,10 @@ class BossPanelSummary(BaseHandler):
             pitcher = arg.get("pitcher")
             type = arg.get("type")
             stage = arg.get("stage")
+            channel = arg.get("channel")
 
             download = arg.get("download")
-            data, total = boss_panel_summary(user_id,start, end, pitcher, type,
+            data, total = boss_panel_summary(user_id,start, end,channel, pitcher, type,
                                              stage, page, page_size, order_by, order)
             if download:
                 self.write_download(str(int(time.time())), data)