|
@@ -12,7 +12,7 @@
|
12
|
12
|
LEFT JOIN ta_share_person_from tspf ON tade.dynamic_id = tspf.target_id
|
13
|
13
|
AND tspf.target_type = 'dynamic_share'
|
14
|
14
|
AND tspf.STATUS = 1
|
15
|
|
- AND tade.person_id = tspf.person_id
|
|
15
|
+ AND tade.person_id = tspf.person_id and tspf.is_first_time = 1
|
16
|
16
|
LEFT JOIN ta_person tp ON tspf.share_person = tp.person_id AND tspf.share_person_type != 'Realty Consultant'
|
17
|
17
|
LEFT JOIN ta_user tu ON tspf.share_person = tu.user_id AND tspf.share_person_type = 'Realty Consultant'
|
18
|
18
|
<where>
|
|
@@ -29,7 +29,7 @@
|
29
|
29
|
and tade.phone like CONCAT('%',#{phone}, '%')
|
30
|
30
|
</if>
|
31
|
31
|
</where>
|
32
|
|
-
|
|
32
|
+ group by tade.person_id
|
33
|
33
|
|
34
|
34
|
</select>
|
35
|
35
|
|
|
@@ -42,12 +42,13 @@
|
42
|
42
|
SELECT
|
43
|
43
|
tade.*,
|
44
|
44
|
(CASE tade.is_checkin WHEN 1 THEN '已签到' ELSE '未签到'END) as isCheckin,
|
45
|
|
- tp.NAME AS sharePersonName,
|
46
|
|
- tp.company AS orgName
|
|
45
|
+ IFNULL(tp.nickname,tu.user_name) AS sharePersonName,
|
|
46
|
+ IFNULL(tp.company,tu.org_name)AS orgName
|
47
|
47
|
FROM
|
48
|
48
|
ta_activity_dynamic_enlist tade
|
49
|
|
- LEFT JOIN ta_share_person_from tspf ON tade.dynamic_id = tspf.target_id AND tspf.target_type = 'dynamic_share' and tspf.status = 1 and tade.person_id = tspf.person_id
|
50
|
|
- LEFT JOIN ta_person tp ON tspf.share_person = tp.user_id
|
|
49
|
+ LEFT JOIN ta_share_person_from tspf ON tade.dynamic_id = tspf.target_id AND tspf.target_type = 'dynamic_share' and tspf.status = 1 and tade.person_id = tspf.person_id and tspf.is_first_time = 1
|
|
50
|
+ LEFT JOIN ta_person tp ON tspf.share_person = tp.person_id AND tspf.share_person_type != 'Realty Consultant'
|
|
51
|
+ LEFT JOIN ta_user tu ON tspf.share_person = tu.user_id AND tspf.share_person_type = 'Realty Consultant'
|
51
|
52
|
<where>
|
52
|
53
|
tade.dynamic_id = #{dynamicId}
|
53
|
54
|
AND tade.org_id = #{orgId}
|
|
@@ -62,6 +63,7 @@
|
62
|
63
|
and tade.phone like CONCAT('%',#{phone}, '%')
|
63
|
64
|
</if>
|
64
|
65
|
</where>
|
|
66
|
+ group by tade.person_id
|
65
|
67
|
limit #{pageCode}, #{pageSize}
|
66
|
68
|
</select>
|
67
|
69
|
</mapper>
|