|
@@ -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,8 +63,8 @@ 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}'
|
|
|
- group by date order by date desc limit 10"""
|
|
|
+ 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))
|
|
|
# print(data)
|