|
@@ -122,6 +122,7 @@ public class CommunityArticleServiceImpl extends ServiceImpl<CommunityArticleMap
|
|
|
//找出板块下的分类
|
|
|
List<Long> classIds = communityArticle.getClassIds();
|
|
|
Long id = communityArticle.getId();
|
|
|
+ List<Long> articleIds = communityArticle.getArticleIds();
|
|
|
Long userId = SecurityUtils.getUserId();
|
|
|
List<CommunityArticleVo> communityArticleVos = null;
|
|
|
if (Objects.nonNull(id)) {
|
|
@@ -131,6 +132,15 @@ public class CommunityArticleServiceImpl extends ServiceImpl<CommunityArticleMap
|
|
|
communityArticleMapper.updateById(article);
|
|
|
}
|
|
|
|
|
|
+ if (!articleIds.isEmpty()) {
|
|
|
+ for (Long articleId : articleIds) {
|
|
|
+ //获取指定文章详细内容,文章浏览量+1
|
|
|
+ CommunityArticle article = communityArticleMapper.selectById(articleId);
|
|
|
+ article.setPageViews(article.getPageViews() + 1);
|
|
|
+ communityArticleMapper.updateById(article);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//根据分类查找文章
|
|
|
int offset = (pageNum - 1) * pageSize;
|
|
|
communityArticleVos = communityArticleMapper.selectCommunityArticleList(communityArticle, classIds, offset, pageSize, searchType);
|