Commit d8d5beda authored by yanghao's avatar yanghao

chore: 客户详情中订单tag查询方式修改为订单页面查询一致的条件

parent 53237f19
...@@ -62,25 +62,28 @@ ...@@ -62,25 +62,28 @@
credit.name_en as credit_level_name_en, credit.name_en as credit_level_name_en,
ec.name_zh as country_name, ec.name_zh as country_name,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone (select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*, from (
c.name as default_contact_name, select a.*,
concat(c.area_code, c.phone_new, '') as default_contact_phone, c.name as default_contact_name,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts concat(c.area_code, c.phone_new, '') as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2, (select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
c.phone_new as contactPhone, s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.id as defaultContactId, c.phone_new as contactPhone,
c.social as default_social, c.id as defaultContactId,
c.email as default_email, c.social as default_social,
c.social_number as default_social_number, c.email as default_email,
c.userid as contact_member_id, c.social_number as default_social_number,
su.nickname as customer_service_name, c.userid as contact_member_id,
su.dept_id as dept_id, su.nickname as customer_service_name,
(SELECT GROUP_CONCAT(name) FROM ecw_customer_competitor n WHERE FIND_IN_SET(n.id,(SELECT competitor_ids FROM ecw_customer WHERE id=a.id))) AS competitor_names, su.dept_id as dept_id,
su.creator as create_username (SELECT GROUP_CONCAT(name) FROM ecw_customer_competitor n WHERE FIND_IN_SET(n.id,(SELECT competitor_ids FROM ecw_customer WHERE id=a.id))) AS competitor_names,
from ecw_customer a su2.creator as create_username
left join (select * from ecw_customer_contacts where is_default = 1 and deleted = 0) as c on a.id = c.customer_id from ecw_customer a
left join system_user su on a.customer_service = su.id left join (select * from ecw_customer_contacts where is_default = 1 and deleted = 0) as c on a.id = c.customer_id
where a.deleted = 0) contact left join system_user su on a.customer_service = su.id
left join system_user su2 on a.creator = su2.id
where a.deleted = 0
) contact
left join ecw_customer_level level left join ecw_customer_level level
on contact.level = level.id on contact.level = level.id
left join ecw_customer_credit credit left join ecw_customer_credit credit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment