|
@@ -118,6 +118,7 @@
|
|
a.is_download,
|
|
a.is_download,
|
|
a.article_type,
|
|
a.article_type,
|
|
a.content_type,
|
|
a.content_type,
|
|
|
|
+ a.is_Draft,
|
|
COALESCE((
|
|
COALESCE((
|
|
SELECT
|
|
SELECT
|
|
JSON_ARRAYAGG(
|
|
JSON_ARRAYAGG(
|
|
@@ -146,29 +147,7 @@
|
|
c.nick_name as nick_name,
|
|
c.nick_name as nick_name,
|
|
c.email as email,
|
|
c.email as email,
|
|
c.avatar as avatar
|
|
c.avatar as avatar
|
|
- # COALESCE((
|
|
|
|
- # SELECT
|
|
|
|
- # JSON_ARRAYAGG(
|
|
|
|
- # CASE
|
|
|
|
- # WHEN d.id IS NOT NULL THEN
|
|
|
|
- # JSON_OBJECT(
|
|
|
|
- # 'id', IFNULL(d.id,''),
|
|
|
|
- # 'articleId', IFNULL(d.article_id,''),
|
|
|
|
- # 'userId', IFNULL(d.user_id,''),
|
|
|
|
- # 'content', IFNULL(d.content,''),
|
|
|
|
- # 'createBy', IFNULL(d.create_by,''),
|
|
|
|
- # 'createTime', IFNULL(DATE_FORMAT(d.create_time,'%Y-%m-%d %H:%i:%s'),''),
|
|
|
|
- # 'updateBy', IFNULL(d.update_by,''),
|
|
|
|
- # 'updateTime', IFNULL(DATE_FORMAT(d.update_time,'%Y-%m-%d %H:%i:%s'),'')
|
|
|
|
- # )
|
|
|
|
- # ELSE NULL
|
|
|
|
- # END
|
|
|
|
- # )
|
|
|
|
- # FROM
|
|
|
|
- # community_article_comment d
|
|
|
|
- # WHERE
|
|
|
|
- # d.article_id = a.id and d.is_delete != 1 order by d.create_time desc
|
|
|
|
- # ), '[]') AS comments
|
|
|
|
|
|
+
|
|
from
|
|
from
|
|
community_article a
|
|
community_article a
|
|
left join sys_user c on a.user_id = c.user_id
|
|
left join sys_user c on a.user_id = c.user_id
|
|
@@ -209,9 +188,9 @@
|
|
#{articleId}
|
|
#{articleId}
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
- <if test="communityArticle.isDraft != null and communityArticle.isDraft != '' ">
|
|
|
|
- AND IFNULL(a.is_Draft,0) = #{communityArticle.isDraft}
|
|
|
|
- </if>
|
|
|
|
|
|
+
|
|
|
|
+ AND IFNULL(a.is_Draft,0) = #{communityArticle.isDraft}
|
|
|
|
+
|
|
<if test="searchType == 3">
|
|
<if test="searchType == 3">
|
|
and EXISTS (select 1 from community_article_recommend car where car.article_id = a.id and car.is_delete != 1 or car.is_delete is null)
|
|
and EXISTS (select 1 from community_article_recommend car where car.article_id = a.id and car.is_delete != 1 or car.is_delete is null)
|
|
</if>
|
|
</if>
|