|
|
@@ -22,9 +22,9 @@
|
|
|
ct.rule_name_list_str
|
|
|
from `corp_tag` ct
|
|
|
left join corp_user_tag cut on cut.tag_id = ct.tag_id
|
|
|
- left join corp_user_follow_relation cufr on cufr.id = cut.relation_id
|
|
|
- left join corp_user_auth cua on cua.external_userid = cufr.corp_user_id
|
|
|
- left join corp_user cu on cu.id = cua.corp_user_id
|
|
|
+ left join corp_user_follow_relation cufr on cufr.id = cut.relation_id and cufr.wx_corp_id = #{wxCorpId}
|
|
|
+ left join corp_user_auth cua on cua.external_userid = cufr.corp_user_id and cua.wx_corp_id = #{wxCorpId}
|
|
|
+ left join corp_user cu on cu.id = cua.corp_user_id and cu.unionid != ''
|
|
|
<where>
|
|
|
<if test="tagIds != null and tagIds.length > 0">
|
|
|
ct.id in
|
|
|
@@ -32,9 +32,6 @@
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- and cufr.wx_corp_id = #{wxCorpId}
|
|
|
- and cua.wx_corp_id = #{wxCorpId}
|
|
|
- and cu.unionid != ''
|
|
|
</where>
|
|
|
group by ct.id, ct.group_name, ct.name, ct.tag_id,ct.group_id,ct.rule_name_list_str order by ct.id desc) s
|
|
|
<if test="sort != null">
|