ck 4 лет назад
Родитель
Сommit
71e438b809
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      data_manage/analysis_select.py

+ 2 - 2
data_manage/analysis_select.py

@@ -37,7 +37,7 @@ def channel_analysis_select(arg):
             (select channel,round(sum(cost),2) cost  from dw_daily_channel_cost
                 where  dt>='{start}' and dt<='{end}' {op} {op1} group by channel) a
                 left join
-            (select channel,round(sum(amount),2) amount from `order` where date>='{st}' and date<='{et}'  and
+            (select channel,round(sum(amount),2) amount from `order` where  date>='{st}' and date<='{et}' and status=2  and
             formatDateTime(reg_time,'%Y-%m-%d')>='{start}' and formatDateTime(reg_time,'%Y-%m-%d')<='{end}' {op} {op1}
             group by channel) b
             using (channel) {op2} {op3}"""
@@ -63,7 +63,7 @@ def channel_analysis_select_daily(arg):
 
 
     sql = f"""select formatDateTime(date,'%Y-%m-%d'),round(sum(amount),2) from `order` where formatDateTime(reg_time,'%Y-%m-%d')>='{start}' and formatDateTime(reg_time,'%Y-%m-%d')<='{end}'
-            and date>='{st}' and date<='{et}' and channel = '{channel}'
+            and date>='{st}' and date<='{et}' and channel = '{channel}' and status=2 
             group by date order by date desc limit 30"""
 
     data = get_dict_list(['dt','amount'],ck.getDataList(sql))