|
@@ -341,19 +341,19 @@ FROM
|
341
|
341
|
SELECT
|
342
|
342
|
count( 1 )
|
343
|
343
|
FROM
|
344
|
|
- ta_recommend_customer tarc
|
345
|
|
- LEFT JOIN ta_person tp ON tarc.recommend_person = tp.person_id
|
|
344
|
+ ta_person tp
|
346
|
345
|
WHERE
|
347
|
|
- tarc.recommend_person = a.person_id and ifnull(tp.person_type, '') = 'customer'
|
|
346
|
+ tp.recommend_agent = a.person_id
|
348
|
347
|
) AS agentCount,
|
349
|
348
|
(
|
350
|
349
|
SELECT
|
351
|
350
|
count( 1 )
|
352
|
351
|
FROM
|
353
|
352
|
ta_recommend_customer tarc
|
354
|
|
- LEFT JOIN ta_person tp ON tarc.recommend_person = tp.person_id
|
355
|
353
|
WHERE
|
356
|
|
- tarc.recommend_person = a.person_id and ifnull(tp.person_type, '') in ('channel agent', 'estate agent')
|
|
354
|
+ tarc.recommend_person = a.person_id
|
|
355
|
+ and tarc.status = 1
|
|
356
|
+ and tarc.org_id = #{orgId}
|
357
|
357
|
) AS recommedCount
|
358
|
358
|
FROM
|
359
|
359
|
ta_person a
|