Skip to content

Commit

Permalink
[FIX] 리뷰 텍스트가 빈문자열일 경우 베스트 리뷰 조회에서 제외되도록 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
seunghaLim committed Sep 5, 2023
1 parent c56fb7f commit 1eaec27
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ List<Review> findBestReviews(
+ "WHERE r.member.breadType.breadTypeId = :currentMemberBreadType "
+ "AND r.isLike = true "
+ "AND r.member.mainPurpose = :currentMemberMainPurpose "
// + "AND r.reviewText <> \"\" "
+ "AND r.reviewText IS NOT NULL AND r.reviewText != '' "
+ "ORDER BY r.createdAt desc")
List<BestReviewDTO> findBestReviewDTOList(
@Param("currentMemberBreadType") Long currentMemberBreadType,
Expand Down Expand Up @@ -89,16 +89,15 @@ List<BestReviewDTO> findBestReviewDTOList(
+ "INNER JOIN Member m ON r.member.memberId = m.memberId "
+ "AND r.isLike = true "
+ "WHERE r.reviewId not in :alreadyFoundReviews "
// + "AND r.reviewText <> \"\" "
+ "AND r.reviewText IS NOT NULL AND r.reviewText != '' "
+ "ORDER BY r.createdAt desc")
List<BestReviewDTO> findRestBestReviewDTOListByBreadType(
@Param("alreadyFoundReviews") List<Long> alreadyFoundReviews, PageRequest pageRequest);

@Query(
"SELECT r FROM Review as r "
+ "WHERE r.isLike = true "
+
// "AND r.reviewText <> \"\" " +
"ORDER BY RAND() ")
+ "AND r.reviewText IS NOT NULL AND r.reviewText != '' "
+ "ORDER BY RAND() ")
List<Review> findRandomReviews(PageRequest pageRequest);
}

0 comments on commit 1eaec27

Please sign in to comment.