|
@@ -277,12 +277,14 @@ public class CommunityCollectionServiceImpl extends ServiceImpl<CommunityCollect
|
|
int offset = (pageNum - 1) * pageSize;
|
|
int offset = (pageNum - 1) * pageSize;
|
|
List<CommunityCollectionVo> communityCollectionVos = communityCollectionMapper.selectUserCollection(userId, articleId, offset, pageSize, searchType);
|
|
List<CommunityCollectionVo> communityCollectionVos = communityCollectionMapper.selectUserCollection(userId, articleId, offset, pageSize, searchType);
|
|
for (CommunityCollectionVo communityCollectionVo : communityCollectionVos) {
|
|
for (CommunityCollectionVo communityCollectionVo : communityCollectionVos) {
|
|
- JSONArray objects = selectArticleInfoInCollection(communityCollectionVo.getId(), 1L);
|
|
|
|
- Long articleNumber = 0L;
|
|
|
|
- if (!objects.isEmpty()){
|
|
|
|
- articleNumber = objects.getJSONObject(0).getLong("articleNumber");
|
|
|
|
- }
|
|
|
|
- communityCollectionVo.setArticleCount(articleNumber);
|
|
|
|
|
|
+ Long aLong = communityCollectionArticleMapper.selectCount(new QueryWrapper<CommunityCollectionArticle>()
|
|
|
|
+ .eq("collection_id", communityCollectionVo.getId())
|
|
|
|
+ .and((wrapper) -> {
|
|
|
|
+ wrapper.ne("is_delete", true)
|
|
|
|
+ .or()
|
|
|
|
+ .isNull("is_delete");
|
|
|
|
+ }));
|
|
|
|
+ communityCollectionVo.setArticleCount(aLong);
|
|
}
|
|
}
|
|
return communityCollectionVos;
|
|
return communityCollectionVos;
|
|
}
|
|
}
|