cola 2 năm trước cách đây
mục cha
commit
f46f42023c
2 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 4 4
      data_manage/pitcher_panel.py
  2. 2 2
      handlers/PitcherPanelHandler.py

+ 4 - 4
data_manage/pitcher_panel.py

@@ -494,7 +494,7 @@ left join dw_channel_user_daily b using(dt,channel) {op5}
     return data, total
 
 
-def get_channel_order_trend(user_id, channel, game,pitcher,agent_id, start, end, page, page_size, order_by, order):
+def get_channel_order_trend(user_id, channel, game,agent_type,pitcher,agent_id, start, end, page, page_size, order_by, order):
     db = MysqlUtils()
     if user_id in super_auth():
         op = ''
@@ -521,7 +521,7 @@ def get_channel_order_trend(user_id, channel, game,pitcher,agent_id, start, end,
     op5 = f" order by {order_by} {order}" if order_by and order else ''
     op6 = f" and agent_id = '{agent_id}' " if agent_id else ''
     op7 = f" and book = '{game}' " if game else ''
-    # op8 = f" and type = '{type}' " if type else ''
+    op8 = f" and type = '{agent_type}' " if agent_type else ''
 
     base_sql_multi_channel = f'''
             (select a.dt,a.agent_name agent_name,a.create_user_num,sum(a.reg_num) reg_num ,group_concat(a.channel) channel ,group_concat(a.pitcher ) pitcher ,
@@ -613,7 +613,7 @@ def get_channel_order_trend(user_id, channel, game,pitcher,agent_id, start, end,
         group_concat(annual_mult) as annual_mult
         from 
          ( select * from  dw_channel where cost+reg_order_amount>0
-         {op} {op1} {op2} {op3} {op4}  {op6} {op7} ) a
+         {op} {op1} {op2} {op3} {op4}  {op6} {op7} {op8}) a
             left join  dw_channel_amount_daily b on a.channel=b.channel 
             and a.dt=b.dt 
             left join src_book_info c on a.dt=c.dt and a.book=c.book
@@ -622,7 +622,7 @@ def get_channel_order_trend(user_id, channel, game,pitcher,agent_id, start, end,
         '''
 
     base_sql_singel_channel = f'''
-        ( select * from  dw_channel where cost+reg_order_amount>0  {op} {op1} {op2} {op3} {op4} {op6} {op7} ) a
+        ( select * from  dw_channel where cost+reg_order_amount>0  {op} {op1} {op2} {op3} {op4} {op6} {op7} {op8}) a
         left join  dw_channel_amount_daily b on a.channel=b.channel and a.dt=b.dt 
         left join src_book_info c on a.dt=c.dt and a.book=c.book  and a.type=c.type and a.platform=c.platform
         '''

+ 2 - 2
handlers/PitcherPanelHandler.py

@@ -149,14 +149,14 @@ class ChannelOrderTrend(BaseHandler):
             agent_id = arg.get("agent_id")
             channel = arg.get("channel")
             game = arg.get("game")
-            # type = arg.get("type")
+            agent_type = arg.get("type")
             start = arg.get("start", self.get_n_days(-30)) if channel else arg.get("start", self.thisday)
             end = arg.get("end")
             page = arg.get("page")
             page_size = arg.get("page_size")
             order_by = arg.get("order_by", 'date')
             order = arg.get("order", 'desc')
-            data, total, total_data = get_channel_order_trend(user_id, channel,game, pitcher, agent_id, start, end, page, page_size,
+            data, total, total_data = get_channel_order_trend(user_id, channel, game,agent_type, pitcher, agent_id, start, end, page, page_size,
                                                               order_by, order)
             if arg.get("download"):
                 self.write_download("channelTrend_" + str(int(time.time())), data)