From b80aee45ebc8a347fc028c05f7ab3cfda1cd2982 Mon Sep 17 00:00:00 2001 From: qianhy Date: Tue, 18 Apr 2023 12:00:24 +0800 Subject: [PATCH] customer statplan fixbug 10030 --- api/controllers/plan/Customer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/controllers/plan/Customer.php b/api/controllers/plan/Customer.php index ac5d3408..d52425a0 100644 --- a/api/controllers/plan/Customer.php +++ b/api/controllers/plan/Customer.php @@ -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.biz_name,''),'未分配门店') 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.biz_name,''),'未分配门店') 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, '加V(扣除 战败-无购车意向)' 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, '加V(扣除 战败-无购车意向)' 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, '未见客户的见面意向' 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