마이페이지 - 라이브 예약 수, 구매내역 추가
This commit is contained in:
@@ -25,6 +25,8 @@ interface LiveReservationQueryRepository {
|
||||
reservationId: Long,
|
||||
memberId: Long
|
||||
): LiveReservation?
|
||||
|
||||
fun getReservationCount(memberId: Long): Int
|
||||
}
|
||||
|
||||
@Repository
|
||||
@@ -97,4 +99,16 @@ class LiveReservationQueryRepositoryImpl(private val queryFactory: JPAQueryFacto
|
||||
)
|
||||
.fetchFirst()
|
||||
}
|
||||
|
||||
override fun getReservationCount(memberId: Long): Int {
|
||||
return queryFactory
|
||||
.selectFrom(liveReservation)
|
||||
.where(
|
||||
liveReservation.member.id.eq(memberId)
|
||||
.and(liveReservation.isActive.isTrue)
|
||||
.and(liveReservation.room.isActive.isTrue)
|
||||
)
|
||||
.fetch()
|
||||
.size
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user