Fixbug 私密日志取消被推荐、私密日志取消被搜索

This commit is contained in:
limqhz
2022-05-16 11:50:11 +08:00
parent 58a77f9902
commit 15658fe016
8 changed files with 58 additions and 15 deletions

View File

@@ -5,7 +5,7 @@
<select id="getTopBlog" resultType="com.quinn.pojo.Blog">
select bid,title,(star + views) as views from
(select bid,title,(select count(1) from qn_star where topic_id = bid and topic_category = 'BLOG') as star,views
from qn_blog where sort = 0) t
from qn_blog where sort = 0 and category_id = '2') t
order by (views + star) desc limit 7
</select>
@@ -34,4 +34,14 @@
limit #{myPageParam.pageNum},#{myPageParam.size}
</select>
<select id="getReadBlog" resultType="com.quinn.pojo.BlogWithUser">
select a.id,a.bid,a.title,a.sort,a.views,a.content,a.author_id,a.category_id,a.category_name,a.gmt_create,a.gmt_update
,b.username,b.avatar,
(select count(1) from qn_star c where c.topic_id = a.bid and c.topic_category = 'BLOG') as star
from qn_blog a,qn_user b
where a.author_id = b.uid
and (case when a.category_id = '1' then a.author_id = #{userId} else 1 end)
and a.bid = #{bid}
</select>
</mapper>

View File

@@ -9,8 +9,9 @@
or a.content_json like CONCAT('%',#{findWhat},'%')
union all
select 1 from qn_blog b
where b.title like CONCAT('%',#{findWhat},'%')
or b.content_json like CONCAT('%',#{findWhat},'%')
where (b.title like CONCAT('%',#{findWhat},'%')
or b.content_json like CONCAT('%',#{findWhat},'%'))
and b.category_id = '2'
) t
</select>