ck 4 năm trước cách đây
mục cha
commit
c3c0cd4c21
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      data_manage/pitcher_panel.py

+ 4 - 3
data_manage/pitcher_panel.py

@@ -68,12 +68,13 @@ def get_pitcher_panel_daily(pitcher, start, end, page, page_size, order_by, orde
                round(if(total_cost=0,0,total_amount/total_cost),4) total_roi
                from dw_daily_channel  where dt>='{start}' and dt<='{end}' """
 
-
-    if pitcher != 'all':
+    if pitcher != '':
         sql += f" and pitcher='{pitcher}' "
 
+    sql+=f" group by date,pitcher"
+
     total = ck.execute(f"select count(1) from ({sql}) a")[0][0]
-    sql += f" group by date,pitcher order by {order_by} {order} limit {(page-1)*page_size},{page_size} "
+    sql += f" order by {order_by} {order} limit {(page-1)*page_size},{page_size} "
     print(sql)
     data = ck.execute(sql)