|
@@ -1197,7 +1197,7 @@
|
1197
|
1197
|
and a.status = 1
|
1198
|
1198
|
and a.is_first_time = 1
|
1199
|
1199
|
<if test="targetType != null and targetType != '' and targetType != 'h5'">
|
1200
|
|
- and a.target_type = #{targetType}
|
|
1200
|
+ and a.target_type = concat(REPLACE(#{targetType}, 'activity', 'dynamic'), '_share')
|
1201
|
1201
|
</if>
|
1202
|
1202
|
<if test="startDate != null ">
|
1203
|
1203
|
and a.create_date >= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
|
|
@@ -1210,8 +1210,7 @@
|
1210
|
1210
|
</if>
|
1211
|
1211
|
group by a.person_id, a.target_type ,a.target_id
|
1212
|
1212
|
) as addRegistNum group by addRegistNum.target_type, addRegistNum.target_id
|
1213
|
|
- ) as addRegistNum on addRegistNum.target_id = activity.activityId and substring_index(addRegistNum.target_type,
|
1214
|
|
- '_share', 1) = activity.activityType
|
|
1213
|
+ ) as addRegistNum on addRegistNum.target_id = activity.activityId and REPLACE(addRegistNum.target_type, 'dynamic_share', 'activity') = activity.activityType
|
1215
|
1214
|
<if test="targetType != null and targetType != ''">
|
1216
|
1215
|
where activity.activityType = #{targetType}
|
1217
|
1216
|
</if>
|
|
@@ -1410,7 +1409,7 @@
|
1410
|
1409
|
and a.status = 1
|
1411
|
1410
|
and a.is_first_time = 1
|
1412
|
1411
|
<if test="targetType != null and targetType != '' and targetType != 'h5'">
|
1413
|
|
- and a.target_type = #{targetType}
|
|
1412
|
+ and a.target_type = concat(REPLACE(#{targetType}, 'activity', 'dynamic'), '_share')
|
1414
|
1413
|
</if>
|
1415
|
1414
|
<if test="startDate != null ">
|
1416
|
1415
|
and a.create_date >= DATE_FORMAT(#{startDate}, '%Y-%m-%d %H:%i:%S' )
|
|
@@ -1423,8 +1422,7 @@
|
1423
|
1422
|
</if>
|
1424
|
1423
|
group by a.person_id, a.target_type ,a.target_id
|
1425
|
1424
|
) as addRegistNum group by addRegistNum.target_type, addRegistNum.target_id
|
1426
|
|
- ) as addRegistNum on addRegistNum.target_id = activity.activityId and substring_index(addRegistNum.target_type,
|
1427
|
|
- '_share', 1) = activity.activityType
|
|
1425
|
+ ) as addRegistNum on addRegistNum.target_id = activity.activityId and REPLACE(addRegistNum.target_type, 'dynamic_share', 'activity') = activity.activityType
|
1428
|
1426
|
<if test="targetType != null and targetType != ''">
|
1429
|
1427
|
where activity.activityType = #{targetType}
|
1430
|
1428
|
</if>
|
|
@@ -1972,18 +1970,18 @@
|
1972
|
1970
|
if(a.gender = '1', '男', if(a.gender = '2', '女','未知') ) as gender,
|
1973
|
1971
|
a.province,
|
1974
|
1972
|
b1.scene_alias as personFrom,
|
1975
|
|
- GROUP_CONCAT(c.name) as realtyConsultant,
|
1976
|
|
- ifnull(d.phone, d.tel) as realtyConsultantPhone,
|
1977
|
|
- ifnull(e.nickname, f.user_name) as sharePersonName,
|
1978
|
|
- ifnull(e.phone, e.tel) as sharePersonPhone
|
|
1973
|
+ GROUP_CONCAT(d.user_name) as realtyConsultant,
|
|
1974
|
+ d.phone as realtyConsultantPhone,
|
|
1975
|
+ ifnull(e.nickname, f.name) as sharePersonName,
|
|
1976
|
+ ifnull(e.phone, f.phone) as sharePersonPhone
|
1979
|
1977
|
FROM ta_share_person_from t
|
1980
|
1978
|
left join ta_person a on t.person_id = a.person_id
|
1981
|
1979
|
left join ta_person_from_record b on a.person_id = b.person_id and b.org_id = #{orgId} and b.is_first_time =1
|
1982
|
1980
|
left join td_wx_dict b1 on b.scene_id = b1.scene_id
|
1983
|
1981
|
left join ta_recommend_customer c on c.person_id = t.person_id
|
1984
|
|
- left join ta_person d on c.recommend_person = d.person_id
|
1985
|
|
- left join ta_person e on t.share_person = e.person_id
|
1986
|
|
- left join ta_user f on t.share_person = f.user_id
|
|
1982
|
+ LEFT JOIN ta_user d ON c.realty_consultant = d.user_id
|
|
1983
|
+ LEFT JOIN ta_person e ON t.share_person = e.person_id
|
|
1984
|
+ LEFT JOIN ta_person f ON t.share_person = f.user_id
|
1987
|
1985
|
WHERE t.target_type in ('dynamic_share','h5_share','help_share','live_share', 'group_share') and t.org_id =
|
1988
|
1986
|
#{orgId} and t.status = 1
|
1989
|
1987
|
and t.is_first_time = 1
|
|
@@ -1993,7 +1991,7 @@
|
1993
|
1991
|
and t.target_id = #{activityId}
|
1994
|
1992
|
</if>
|
1995
|
1993
|
<if test="activityType != null and activityType != ''">
|
1996
|
|
- and t.target_type = concat(#{activityType}, '_share')
|
|
1994
|
+ and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
|
1997
|
1995
|
</if>
|
1998
|
1996
|
<if test="province != null and province != ''">
|
1999
|
1997
|
and a.province like concat('%', #{province}, '%')
|
|
@@ -2035,7 +2033,7 @@
|
2035
|
2033
|
and t.target_id = #{activityId}
|
2036
|
2034
|
</if>
|
2037
|
2035
|
<if test="activityType != null and activityType != ''">
|
2038
|
|
- and t.target_type = concat(#{activityType}, '_share')
|
|
2036
|
+ and t.target_type = concat(REPLACE(#{activityType}, 'activity', 'dynamic'), '_share')
|
2039
|
2037
|
</if>
|
2040
|
2038
|
<if test="province != null and province != ''">
|
2041
|
2039
|
and a.province like concat('%', #{province}, '%')
|