Skip to content

Commit 59333c8

Browse files
committed
[fix] 일주일치 채팅 반환시 서울 타임존으로 수정
1 parent fe88687 commit 59333c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/Ness/Backend/domain/chat/ChatRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public interface ChatRepository extends JpaRepository<Chat, Long>{
1414
// 특정 맴버의 일주일치 데이터만 반환
1515
@Query( value = "SELECT * FROM chat " +
1616
"WHERE member_id = :memberId " +
17-
"AND created_date >= DATE_SUB(NOW(), INTERVAL 1 WEEK) " +
17+
"AND CONVERT_TZ(created_date, '+00:00', '+09:00') >= DATE_SUB(CONVERT_TZ(NOW(), '+00:00', '+09:00'), INTERVAL 1 WEEK) " +
1818
//"AND created_date BETWEEN DATE_ADD(NOW(), INTERVAL -1 WEEK) AND NOW() " +
1919
"ORDER BY created_date ASC",
2020
nativeQuery = true)

0 commit comments

Comments
 (0)