customer statplan fixbug 10030
This commit is contained in:
@@ -55,7 +55,7 @@ class Customer extends HD_Controller
|
||||
union all
|
||||
select 3 as group_id, concat(ct.name) as k, count(*) as v from lc_receiver_customers c left join lc_biz b on c.biz_id = b.id left join lc_sys_city ct on b.city_id = ct.city_id where c.of_id = @of_id and c.of2_id = @of2_id and c.c_time >= UNIX_TIMESTAMP('@s_date') group by k
|
||||
union all
|
||||
select c.biz_id * 10 as group_id, if(c.biz_id,concat('<b>',b.biz_name,'</b>'),'<b>未分配门店</b>') k, count(*) as v from lc_receiver_customers c left join lc_biz b on c.biz_id = b.id where c.of_id = @of_id and c.of2_id = @of2_id and c.c_time >= UNIX_TIMESTAMP('@s_date') group by group_id, k
|
||||
select c.biz_id * 10 as group_id, if(c.biz_id,concat('<b>',b.biz_name,'</b>'),'<b>未分配门店</b>') as k, count(*) as v from lc_receiver_customers c left join lc_biz b on c.biz_id = b.id where c.of_id = @of_id and c.of2_id = @of2_id and c.c_time >= UNIX_TIMESTAMP('@s_date') group by group_id, k
|
||||
union all
|
||||
select (c.biz_id * 10 + 1) as group_id, if(c.admin_id,concat(' - ',b.biz_name,'-', u.uname), ' - 未分配') as k, count(*) as v from lc_receiver_customers c left join lc_biz b on c.biz_id = b.id left join lc_app_licheb_users u on c.admin_id = u.id where c.of_id = @of_id and c.of2_id = @of2_id and c.c_time >= UNIX_TIMESTAMP('@s_date') group by group_id,k
|
||||
union all
|
||||
@@ -75,7 +75,7 @@ class Customer extends HD_Controller
|
||||
union all
|
||||
select 10021 as group_id, ' - 战败-有购车意向-对产品不满意' as k, count(*) as v from lc_receiver_customers c where c.of_id = @of_id and c.of2_id = @of2_id and c.c_time >= UNIX_TIMESTAMP('@s_date') and c.status = 3 and id in (select c_id from lc_receiver_customers_tagdata where t_id in (select id from lc_receiver_customers_tag where tag_type = 1 and pid in (111))) group by k
|
||||
union all
|
||||
select 10030 as group_id, '<b>加V(扣除 战败-无购车意向)</b>' as k, count(*) as v from lc_receiver_customers c where c.of_id = @of_id and c.of2_id = @of2_id and c.c_time >= UNIX_TIMESTAMP('@s_date') and id in (select c_id from lc_receiver_customers_tagdata where t_id not in (select id from lc_receiver_customers_tag where tag_type = 1 and pid in (103, 107))) and wxgr = 1 group by k
|
||||
select 10030 as group_id, '<b>加V(扣除 战败-无购车意向)</b>' as k, count(*) as v from lc_receiver_customers c where c.of_id = @of_id and c.of2_id = @of2_id and c.c_time >= UNIX_TIMESTAMP('@s_date') and id not in (select c_id from lc_receiver_customers_tagdata where t_id in (select id from lc_receiver_customers_tag where tag_type = 1 and pid in (103, 107))) and wxgr = 1 group by k
|
||||
union all
|
||||
select 10040 as group_id, '<b>未见客户的见面意向</b>' as k, count(*) as v from lc_receiver_customers_tagdata td join lc_receiver_customers_tag t on td.t_id = t.id where t.tag_type = 2 and t.pid in (120) and td.c_id in (select id from lc_receiver_customers c where c.of_id = @of_id and c.of2_id = @of2_id and c.c_time >= UNIX_TIMESTAMP('@s_date') and c.status = 0) group by k
|
||||
union all
|
||||
|
||||
Reference in New Issue
Block a user