Skip to content

Commit

Permalink
fix: 修改分页逻辑
Browse files Browse the repository at this point in the history
前端获取分页时 ,只获取了所有公开的文章数量, 并没有获取私密的文章,导致分页容易出现问题;所以需要将私密的数量也加上去
  • Loading branch information
leveljava committed Aug 26, 2023
1 parent 2036d9a commit dfbb50a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public TopAndFeaturedArticlesDTO listTopAndFeaturedArticles() {
public PageResultDTO<ArticleCardDTO> listArticles() {
LambdaQueryWrapper<Article> queryWrapper = new LambdaQueryWrapper<Article>()
.eq(Article::getIsDelete, 0)
.eq(Article::getStatus, 1);
.in(Article::getStatus, 1, 2);
CompletableFuture<Integer> asyncCount = CompletableFuture.supplyAsync(() -> articleMapper.selectCount(queryWrapper));
List<ArticleCardDTO> articles = articleMapper.listArticles(PageUtil.getLimitCurrent(), PageUtil.getSize());
return new PageResultDTO<>(articles, asyncCount.get());
Expand Down

0 comments on commit dfbb50a

Please sign in to comment.