ck 4 rokov pred
rodič
commit
8e2906fd71
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      data_manage/pitcher_panel.py

+ 1 - 1
data_manage/pitcher_panel.py

@@ -138,7 +138,7 @@ def get_channel_overview(channel,pitcher,start,end,page,page_size,order_by,order
        round(total_amount,2) total_amount,
        round(if(cost=0,0,first_order_amount/cost),4) day_roi,
        round(if(cost=0,0,reg_order_amount/cost),4) all_roi,
-       0 avg_new_order_rate,
+       if(total_cost=0,0,total_first_amount/total_cost)  avg_new_order_rate,
        if(reg_order_user=0,0,reg_order_user_again/reg_order_user)  old_user_once_order_rate from dw_daily_channel where 1=1 """
     if channel!='':
         sql+=f" and channel='{channel}'"