|
@@ -80,7 +80,28 @@
|
|
|
from community_comment_like ccl
|
|
|
left join community_comment_reply ccr on ccl.reply_id = ccr.id
|
|
|
left join community_article_comment cac on ccr.id = ccr.comment_id
|
|
|
- where ccr.user_id = #{userId} and ccl.user_id != #{userId} and (ccl.is_notice != 1 or ccl.is_notice is null) ) result
|
|
|
+ where ccr.user_id = #{userId} and ccl.user_id != #{userId} and (ccl.is_notice != 1 or ccl.is_notice is null)
|
|
|
+ union all
|
|
|
+ select cl.id,
|
|
|
+ cl.article_id,
|
|
|
+ ca.id as third_id,
|
|
|
+ cl.user_id,
|
|
|
+ cl.create_time,
|
|
|
+ (select su.nick_name from sys_user su where su.user_id = cl.user_id) as nick_name,
|
|
|
+ (select su.avatar from sys_user su where su.user_id = cl.user_id) as avatar,
|
|
|
+ (select cai.image_url
|
|
|
+ from community_article_images cai
|
|
|
+ where cai.article_id = cl.article_id
|
|
|
+ limit 1) as image_url,
|
|
|
+ '' as content,
|
|
|
+ cl.is_read,
|
|
|
+ '10' as type
|
|
|
+ from community_like cl
|
|
|
+ left join community_article ca on cl.article_id = ca.id
|
|
|
+ where ca.user_id = #{userId} and cl.user_id != #{userId} and (cl.is_notice != 1 or cl.is_notice is null)
|
|
|
+ and (ca.is_delete != 1 or ca.is_delete is null)
|
|
|
+ and (ca.is_draft != 1 or ca.is_draft is null)
|
|
|
+ ) result
|
|
|
<if test="searchType == 1">
|
|
|
order by result.create_time desc
|
|
|
</if>
|