|
@@ -2670,14 +2670,14 @@
|
|
|
from (
|
|
|
select t1.user_id as 'collectSampleId',
|
|
|
t1.user_name as 'collectSampleName',
|
|
|
- sum(t2.order_num) as 'orderNum',
|
|
|
- sum(t2.valid_order_num) as 'validOrderNum',
|
|
|
- concat(round(sum(t2.valid_order_num) / sum(t2.order_num) * 100, 2), '%') as 'validOrderRate',
|
|
|
+ count(t2.oid) as 'orderNum',
|
|
|
+ sum(case when t2.order_status != 80 then 1 else 0 end) as 'validOrderNum',
|
|
|
+ concat(round(sum(case when t2.order_status != 80 then 1 else 0 end) / count(t2.oid) * 100, 2), '%') as 'validOrderRate',
|
|
|
round(sum(t2.order_amount) / 100, 2) as 'orderAmount',
|
|
|
round(sum(t2.regimental_promotion_amount) / 100, 2) as 'regimentalPromotionAmount',
|
|
|
round(sum(t2.total_regimental_settle_amount) / 100, 2) as 'totalRegimentalSettleAmount'
|
|
|
from promoter_bind_channel_date t1
|
|
|
- left join promoter_item_order_count t2
|
|
|
+ left join kuaishou_supply_chain t2
|
|
|
on t1.promoter_id = t2.promoter_id and t1.stat_date = t2.stat_date
|
|
|
where 1 = 1
|
|
|
and t1.media_id = 2
|
|
@@ -2797,15 +2797,15 @@
|
|
|
IFNULL(ttttt.promoters_count, '-') as 'promotersCount'
|
|
|
from (select t1.user_id as 'collectSampleId',
|
|
|
t1.user_name as 'collectSampleName',
|
|
|
- sum(t2.order_num) as 'orderNum',
|
|
|
- sum(t2.valid_order_num) as 'validOrderNum',
|
|
|
- concat(round(sum(t2.valid_order_num) / sum(t2.order_num) * 100, 2), '%') as 'validOrderRate',
|
|
|
+ count(t2.oid) as 'orderNum',
|
|
|
+ sum(case when t2.order_status != 80 then 1 else 0 end) as 'validOrderNum',
|
|
|
+ concat(round(sum(case when t2.order_status != 80 then 1 else 0 end) / count(t2.oid) * 100, 2), '%') as 'validOrderRate',
|
|
|
round(sum(t2.order_amount) / 100, 2) as 'orderAmount',
|
|
|
round(sum(t2.regimental_promotion_amount) / 100, 2) as 'regimentalPromotionAmount',
|
|
|
round(sum(t2.total_regimental_settle_amount) / 100, 2) as 'totalRegimentalSettleAmount'
|
|
|
from kuaishou_promoter t1
|
|
|
left join(select *
|
|
|
- from promoter_item_order_count
|
|
|
+ from kuaishou_supply_chain
|
|
|
where stat_date >= #{bindStartDate}) t2
|
|
|
on t1.promoter_id = t2.promoter_id
|
|
|
where 1 = 1
|