|
@@ -111,12 +111,13 @@ FROM
|
111
|
111
|
SELECT
|
112
|
112
|
a.*,
|
113
|
113
|
a.customer_id AS customerId,
|
114
|
|
- b.NAME AS consultantName,
|
115
|
|
- b.tel AS consultTel,
|
|
114
|
+ if(b.NAME = null, d.name, b.name) as consultantName,
|
|
115
|
+ if(b.tel = null, d.tel, b.tel) AS consultTel,
|
116
|
116
|
c.building_name as intentionName
|
117
|
117
|
FROM
|
118
|
118
|
ta_recommend_customer a
|
119
|
|
- LEFT JOIN ta_person b ON (a.realty_consultant = b.person_id or a.realty_consultant = b.user_id)
|
|
119
|
+ LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
|
|
120
|
+ LEFT JOIN ta_person d on a.realty_consultant = d.user_id
|
120
|
121
|
LEFT JOIN ta_building c ON a.building_id = c.building_id
|
121
|
122
|
<where>
|
122
|
123
|
a.status > 0
|