From 52282a8530460db153f97d0d187105ec1d1f0398 Mon Sep 17 00:00:00 2001 From: hyeonjaez Date: Thu, 19 Sep 2024 21:25:03 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20gathering=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EB=84=A4=EC=9D=B4=EC=85=98=20=EB=AA=A8=EC=9E=84=20=EC=88=AB?= =?UTF-8?q?=EC=9E=90=20=EC=98=A4=EB=A5=98,=20home=20=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=A2=8B=EC=95=84=EC=9A=94=20=ED=96=88=EB=8A=94=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gathering/repository/GatheringRepositoryImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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())) {