diff --git a/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml index fa27bbe6b..c28c58138 100644 --- a/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCUserFromMapper.xml @@ -152,7 +152,7 @@ ) a left join ( select wcuf.from_id, - count(wcuf.c_user_id) reach_user + count(DISTINCT wcuf.c_user_id) reach_user from wx_c_user_from wcuf where wcuf.from_type = #{fromType} @@ -167,11 +167,11 @@ and wcuf.`create_date` <= #{endDate} - group by wcuf.from_id,wcuf.c_user_id + group by wcuf.from_id ) b on b.from_id = a.from_id left join ( select wcuf.from_id, - count(wcuf.c_user_id) new_user + count(DISTINCT wcuf.c_user_id) new_user from wx_c_user_from wcuf where wcuf.from_type = #{fromType} and wcuf.is_new_user = 1 @@ -187,7 +187,7 @@ and wcuf.`create_date` <= #{endDate} - group by wcuf.from_id,wcuf.c_user_id + group by wcuf.from_id ) c on c.from_id = a.from_id order by a.visits desc