diff --git a/src/main/java/solitour_backend/solitour/gathering/repository/GatheringRepositoryImpl.java b/src/main/java/solitour_backend/solitour/gathering/repository/GatheringRepositoryImpl.java index 61d7b28..bc9a1d9 100644 --- a/src/main/java/solitour_backend/solitour/gathering/repository/GatheringRepositoryImpl.java +++ b/src/main/java/solitour_backend/solitour/gathering/repository/GatheringRepositoryImpl.java @@ -112,9 +112,10 @@ public Page getGatheringPageFilterAndOrder(Pageable page .on(bookMarkGathering.gathering.id.eq(gathering.id).and(bookMarkGathering.user.id.eq(userId))) .leftJoin(gatheringApplicants).on(gatheringApplicants.gathering.id.eq(gathering.id)) .where(booleanBuilder) - .select(gathering.id.count()).fetchCount(); + .select(gathering.id.countDistinct()).fetchCount(); List content = from(gathering) + .distinct() .join(zoneCategoryChild).on(zoneCategoryChild.id.eq(gathering.zoneCategory.id)) .leftJoin(zoneCategoryParent).on(zoneCategoryParent.id.eq(zoneCategoryChild.parentZoneCategory.id)) .leftJoin(bookMarkGathering) @@ -236,10 +237,10 @@ public List getGatheringRankList() { public List getGatheringLikeCountFromCreatedIn3(Long userId) { NumberExpression likeCount = countGreatGatheringByGatheringById(); return from(gathering) + .distinct() .join(zoneCategoryChild).on(zoneCategoryChild.id.eq(gathering.zoneCategory.id)) .leftJoin(zoneCategoryParent).on(zoneCategoryParent.id.eq(zoneCategoryChild.parentZoneCategory.id)) - .leftJoin(bookMarkGathering) - .on(bookMarkGathering.gathering.id.eq(gathering.id).and(bookMarkGathering.user.id.eq(userId))) + .leftJoin(bookMarkGathering).on(bookMarkGathering.gathering.id.eq(gathering.id).and(bookMarkGathering.user.id.eq(userId))) .leftJoin(category).on(category.id.eq(gathering.gatheringCategory.id)) .leftJoin(gatheringApplicants).on(gatheringApplicants.gathering.id.eq(gathering.id).and(gatheringApplicants.gatheringStatus.eq(GatheringStatus.CONSENT))) .where(gathering.isFinish.eq(Boolean.FALSE) @@ -261,7 +262,7 @@ public List getGatheringLikeCountFromCreatedIn3(Long use gathering.viewCount, bookMarkGathering.user.id.isNotNull(), likeCount, - category.name, + gathering.gatheringCategory.name, gathering.user.name, gathering.scheduleStartDate, gathering.scheduleEndDate, @@ -280,7 +281,6 @@ private BooleanBuilder makeWhereSQL(GatheringPageRequest gatheringPageRequest) { BooleanBuilder whereClause = new BooleanBuilder(); whereClause.and(gathering.isDeleted.eq(Boolean.FALSE)); -// whereClause.and(gathering.deadline.after(LocalDateTime.now())); if (Objects.nonNull(gatheringPageRequest.getCategory())) { whereClause.and(gathering.gatheringCategory.id.eq(gatheringPageRequest.getCategory())); } @@ -308,6 +308,7 @@ private BooleanBuilder makeWhereSQL(GatheringPageRequest gatheringPageRequest) { if (Objects.isNull(gatheringPageRequest.getIsExclude())) { whereClause.and(gathering.isFinish.eq(Boolean.FALSE)); + whereClause.and(gathering.deadline.after(LocalDateTime.now())); } if (Objects.nonNull(gatheringPageRequest.getSearch())) {