Commit 484f05fd authored by liwei's avatar liwei

修改了bug

parent 8ee88be4
......@@ -543,12 +543,14 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
dto.setCreateBy(Integer.valueOf(CyUserUtil.getAuthenBusinessId()));
dto.setUpdateBy(Integer.valueOf(CyUserUtil.getAuthenBusinessId()));
int line = baseMapper.addComment(dto);
if (dto.getExamStatus().equals("1")){
//修改主表的评论数
baseMapper.addArticleCommentCount(dto.getArticleId());
//修改子表的评论数 给父级评论数+1
if (dto.getParentId() != null){
baseMapper.addCommentCount(dto.getParentId());
}
}
return new CyPersistModel(1);
}
}
......@@ -391,7 +391,8 @@
WHERE 1 = 1
AND opc.del_flag = '0'
AND opc.parent_id is null
AND opc.article_id = 6
AND opc.article_id = #{articleId}
and opc.exam_status = '1'
AND NOT EXISTS (
SELECT 1 FROM opm_black_list obl
WHERE (obl.user_id = #{loginUserId} AND obl.target_id = opc.user_id)
......@@ -444,12 +445,12 @@
<insert id="addComment">
INSERT INTO opm_article_comment
(
create_by, create_date, update_by, update_date, content, parent_id, article_id, user_id
create_by, create_date, update_by, update_date, content, parent_id, article_id, user_id,exam_status
)
VALUES
(
#{entity.createBy}, #{entity.createDate},#{entity.updateBy},#{entity.updateDate},
#{entity.commentContent},#{entity.parentId},#{entity.articleId},#{entity.commentedUserId}
#{entity.commentContent},#{entity.parentId},#{entity.articleId},#{entity.commentedUserId},#{entity.examStatus}
)
</insert>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment