ck 4 lat temu
rodzic
commit
e681348add
1 zmienionych plików z 3 dodań i 5 usunięć
  1. 3 5
      data_manage/pitcher_panel.py

+ 3 - 5
data_manage/pitcher_panel.py

@@ -749,7 +749,7 @@ def get_channel_summary(channel,pitcher,page,page_size,order_by,order,state):
 
 
 
-    sql = f"""select a.channel channel,state,'朋友圈' location,toString(start) start,toString(end) end,
+    sql = f"""select a.channel channel,state,'朋友圈' location,toString(a.start) start,toString(a.end) end,
                 toDecimal32(total_cost,2),toDecimal32(total_amount,2),
                         toDecimal32(profit,2),roi,follow_user,toDecimal32(follow_per_cost,2),order_user,
                 if(follow_user=0,0,order_user/follow_user) order_tran_rate,toDecimal32(if(order_user=0,0,total_cost/order_user),2) order_tran_cost,
@@ -757,7 +757,7 @@ def get_channel_summary(channel,pitcher,page,page_size,order_by,order,state):
                 from
                 (
                 select channel,if(max(dt)>subtractDays(today(),10),'在投','停投') state,
-                       min(dt) start,max(dt) end
+                       min(if(cost>0,dt,null)) start,max(if(cost>0,dt,null) ) end
                        from dw_daily_channel_cost where 1=1 {pitcher_op} {channel_op}  group by channel) a
 
                 left outer join(
@@ -778,9 +778,7 @@ def get_channel_summary(channel,pitcher,page,page_size,order_by,order,state):
                 from dw_channel_daily_total where dt=today() {channel_op}) d on a.channel=d.channel 
                 left outer join (
                     select pitcher,channel from dw_daily_channel_cost where dt=today() group by pitcher,channel
-                ) e on a.channel=e.channel 
-
-                            
+                ) e on a.channel=e.channel                
                 
                 """
     print(sql)