|
@@ -63,7 +63,7 @@ from (select
|
|
from {database}.kuaishou_item_bind_user t1
|
|
from {database}.kuaishou_item_bind_user t1
|
|
left join {database}.kuaishou_supply_chain t2
|
|
left join {database}.kuaishou_supply_chain t2
|
|
on t1.item_id = t2.item_id
|
|
on t1.item_id = t2.item_id
|
|
- left join (select id,reg_name from {database}.kuaishou_supply_chain_cookie union all
|
|
|
|
|
|
+ left join (select id,reg_name from ruixuan.kuaishou_supply_chain_cookie union all
|
|
select id,reg_name from miaogousi.kuaishou_supply_chain_cookie union all
|
|
select id,reg_name from miaogousi.kuaishou_supply_chain_cookie union all
|
|
select id,reg_name from yufu.kuaishou_supply_chain_cookie union all
|
|
select id,reg_name from yufu.kuaishou_supply_chain_cookie union all
|
|
select id,reg_name from rocket.kuaishou_supply_chain_cookie union all
|
|
select id,reg_name from rocket.kuaishou_supply_chain_cookie union all
|
|
@@ -76,7 +76,7 @@ on t2.regimental_id=t5.id
|
|
and t2.stat_date >= DATE_FORMAT(NOW() - INTERVAL 1 MONTH, '%%Y%%m01')
|
|
and t2.stat_date >= DATE_FORMAT(NOW() - INTERVAL 1 MONTH, '%%Y%%m01')
|
|
and t2.stat_date <= DATE_FORMAT(LAST_DAY(NOW() - INTERVAL 1 MONTH), '%%Y%%m%%d')
|
|
and t2.stat_date <= DATE_FORMAT(LAST_DAY(NOW() - INTERVAL 1 MONTH), '%%Y%%m%%d')
|
|
|
|
|
|
- group by t1.user_id) t
|
|
|
|
|
|
+ group by t2.regimental_id,t1.user_id) t
|
|
left join (select item_create_id, count(1) as 'sendSampleCount'
|
|
left join (select item_create_id, count(1) as 'sendSampleCount'
|
|
from {database}.kuaishou_item_collect_samples
|
|
from {database}.kuaishou_item_collect_samples
|
|
where courier_number_time >= str_to_date(concat(date_format( DATE_FORMAT(NOW() - INTERVAL 1 MONTH, '%%Y-%%m-01'), '%%Y-%%m-%%d'), '00:00:01'), '%%Y-%%m-%%d %%H:%%i:%%s')
|
|
where courier_number_time >= str_to_date(concat(date_format( DATE_FORMAT(NOW() - INTERVAL 1 MONTH, '%%Y-%%m-01'), '%%Y-%%m-%%d'), '00:00:01'), '%%Y-%%m-%%d %%H:%%i:%%s')
|