관리자 광고통계, 일별 전체 회원 수 #288
|
@ -61,12 +61,7 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
|
||||||
.sumOf { it.memberCount }
|
.sumOf { it.memberCount }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getSignUpCountInRange(
|
fun getSignUpCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
||||||
startDate: LocalDateTime,
|
|
||||||
endDate: LocalDateTime,
|
|
||||||
offset: Long,
|
|
||||||
limit: Long
|
|
||||||
): List<DateAndMemberCount> {
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
QDateAndMemberCount(
|
QDateAndMemberCount(
|
||||||
|
@ -81,17 +76,10 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
|
||||||
)
|
)
|
||||||
.groupBy(getFormattedDate(member.createdAt))
|
.groupBy(getFormattedDate(member.createdAt))
|
||||||
.orderBy(getFormattedDate(member.createdAt).desc())
|
.orderBy(getFormattedDate(member.createdAt).desc())
|
||||||
.offset(offset)
|
|
||||||
.limit(limit)
|
|
||||||
.fetch()
|
.fetch()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getSignOutCountInRange(
|
fun getSignOutCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
||||||
startDate: LocalDateTime,
|
|
||||||
endDate: LocalDateTime,
|
|
||||||
offset: Long,
|
|
||||||
limit: Long
|
|
||||||
): List<DateAndMemberCount> {
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
QDateAndMemberCount(
|
QDateAndMemberCount(
|
||||||
|
@ -106,17 +94,10 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
|
||||||
)
|
)
|
||||||
.groupBy(getFormattedDate(signOut.createdAt))
|
.groupBy(getFormattedDate(signOut.createdAt))
|
||||||
.orderBy(getFormattedDate(signOut.createdAt).desc())
|
.orderBy(getFormattedDate(signOut.createdAt).desc())
|
||||||
.offset(offset)
|
|
||||||
.limit(limit)
|
|
||||||
.fetch()
|
.fetch()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getPaymentMemberCountInRange(
|
fun getPaymentMemberCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
||||||
startDate: LocalDateTime,
|
|
||||||
endDate: LocalDateTime,
|
|
||||||
offset: Long,
|
|
||||||
limit: Long
|
|
||||||
): List<DateAndMemberCount> {
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
QDateAndMemberCount(
|
QDateAndMemberCount(
|
||||||
|
@ -135,8 +116,6 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
|
||||||
)
|
)
|
||||||
.groupBy(getFormattedDate(charge.createdAt))
|
.groupBy(getFormattedDate(charge.createdAt))
|
||||||
.orderBy(getFormattedDate(charge.createdAt).desc())
|
.orderBy(getFormattedDate(charge.createdAt).desc())
|
||||||
.offset(offset)
|
|
||||||
.limit(limit)
|
|
||||||
.fetch()
|
.fetch()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,23 +61,17 @@ class AdminMemberStatisticsService(private val repository: AdminMemberStatistics
|
||||||
|
|
||||||
val signUpCountInRange = repository.getSignUpCountInRange(
|
val signUpCountInRange = repository.getSignUpCountInRange(
|
||||||
startDate = startDateTime,
|
startDate = startDateTime,
|
||||||
endDate = endDateTime,
|
endDate = endDateTime
|
||||||
offset = pageable.offset,
|
|
||||||
limit = pageable.pageSize.toLong()
|
|
||||||
).associateBy({ it.date }, { it.memberCount })
|
).associateBy({ it.date }, { it.memberCount })
|
||||||
|
|
||||||
val signOutCountInRange = repository.getSignOutCountInRange(
|
val signOutCountInRange = repository.getSignOutCountInRange(
|
||||||
startDate = startDateTime,
|
startDate = startDateTime,
|
||||||
endDate = endDateTime,
|
endDate = endDateTime
|
||||||
offset = pageable.offset,
|
|
||||||
limit = pageable.pageSize.toLong()
|
|
||||||
).associateBy({ it.date }, { it.memberCount })
|
).associateBy({ it.date }, { it.memberCount })
|
||||||
|
|
||||||
val paymentMemberCountInRange = repository.getPaymentMemberCountInRange(
|
val paymentMemberCountInRange = repository.getPaymentMemberCountInRange(
|
||||||
startDate = startDateTime,
|
startDate = startDateTime,
|
||||||
endDate = endDateTime,
|
endDate = endDateTime
|
||||||
offset = pageable.offset,
|
|
||||||
limit = pageable.pageSize.toLong()
|
|
||||||
)
|
)
|
||||||
|
|
||||||
val paymentMemberCountInRangeMap = paymentMemberCountInRange.associateBy({ it.date }, { it.memberCount })
|
val paymentMemberCountInRangeMap = paymentMemberCountInRange.associateBy({ it.date }, { it.memberCount })
|
||||||
|
|
Loading…
Reference in New Issue