|
@@ -178,11 +178,16 @@ public class CommunityCollectionServiceImpl extends ServiceImpl<CommunityCollect
|
|
|
if (searchType == 1) {
|
|
|
// 查询最新的文章
|
|
|
communityArticles = communityArticleMapper.selectList(
|
|
|
- new QueryWrapper<CommunityArticle>().in("id", articleIds).and((wrapper) -> {
|
|
|
- wrapper.ne("is_delete", true)
|
|
|
+ new QueryWrapper<CommunityArticle>().in("id", articleIds)
|
|
|
+ .and((wrapper) -> {wrapper.ne("is_delete", true)
|
|
|
.or()
|
|
|
.isNull("is_delete");
|
|
|
- }).orderByDesc("create_time"));
|
|
|
+ }).and((wrapper) -> {
|
|
|
+ wrapper.ne("is_draft", true)
|
|
|
+ .or()
|
|
|
+ .isNull("is_draft");
|
|
|
+ })
|
|
|
+ .orderByDesc("create_time"));
|
|
|
} else {
|
|
|
// 查询最早的文章
|
|
|
communityArticles = communityArticleMapper.selectList(
|
|
@@ -190,7 +195,12 @@ public class CommunityCollectionServiceImpl extends ServiceImpl<CommunityCollect
|
|
|
wrapper.ne("is_delete", true)
|
|
|
.or()
|
|
|
.isNull("is_delete");
|
|
|
- }).orderByAsc("create_time"));
|
|
|
+ }).and((wrapper) -> {
|
|
|
+ wrapper.ne("is_draft", true)
|
|
|
+ .or()
|
|
|
+ .isNull("is_draft");
|
|
|
+ })
|
|
|
+ .orderByAsc("create_time"));
|
|
|
}
|
|
|
collectionObject.put("articleNumber", communityArticles.size());
|
|
|
|
|
@@ -281,7 +291,7 @@ public class CommunityCollectionServiceImpl extends ServiceImpl<CommunityCollect
|
|
|
public List<CommunityCollectionVo> selectUserCollection(Long userId, Long articleId, int pageNum, int pageSize, int searchType) {
|
|
|
int offset = (pageNum - 1) * pageSize;
|
|
|
List<CommunityCollectionVo> communityCollectionVos = communityCollectionMapper.selectUserCollection(userId, articleId, offset, pageSize, searchType);
|
|
|
- for (CommunityCollectionVo communityCollectionVo : communityCollectionVos) {
|
|
|
+ /*for (CommunityCollectionVo communityCollectionVo : communityCollectionVos) {
|
|
|
Long aLong = communityCollectionArticleMapper.selectCount(new QueryWrapper<CommunityCollectionArticle>()
|
|
|
.eq("collection_id", communityCollectionVo.getId())
|
|
|
.and((wrapper) -> {
|
|
@@ -290,7 +300,7 @@ public class CommunityCollectionServiceImpl extends ServiceImpl<CommunityCollect
|
|
|
.isNull("is_delete");
|
|
|
}));
|
|
|
communityCollectionVo.setArticleCount(aLong);
|
|
|
- }
|
|
|
+ }*/
|
|
|
return communityCollectionVos;
|
|
|
}
|
|
|
|