일별 전체 회원 수에 애플 계정으로 회원 가입 수 추가
This commit is contained in:
@@ -68,6 +68,19 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
|
|||||||
.size
|
.size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getTotalSignUpAppleCount(startDate: LocalDateTime, endDate: LocalDateTime): Int {
|
||||||
|
return queryFactory
|
||||||
|
.select(member.id)
|
||||||
|
.from(member)
|
||||||
|
.where(
|
||||||
|
member.createdAt.goe(startDate),
|
||||||
|
member.createdAt.loe(endDate),
|
||||||
|
member.provider.eq(MemberProvider.APPLE)
|
||||||
|
)
|
||||||
|
.fetch()
|
||||||
|
.size
|
||||||
|
}
|
||||||
|
|
||||||
fun getTotalSignUpLineCount(startDate: LocalDateTime, endDate: LocalDateTime): Int {
|
fun getTotalSignUpLineCount(startDate: LocalDateTime, endDate: LocalDateTime): Int {
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(member.id)
|
.select(member.id)
|
||||||
@@ -202,6 +215,25 @@ class AdminMemberStatisticsRepository(private val queryFactory: JPAQueryFactory)
|
|||||||
.fetch()
|
.fetch()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getSignUpAppleCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
||||||
|
return queryFactory
|
||||||
|
.select(
|
||||||
|
QDateAndMemberCount(
|
||||||
|
getFormattedDate(member.createdAt),
|
||||||
|
member.id.countDistinct().castToNum(Int::class.java)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.from(member)
|
||||||
|
.where(
|
||||||
|
member.createdAt.goe(startDate),
|
||||||
|
member.createdAt.loe(endDate),
|
||||||
|
member.provider.eq(MemberProvider.APPLE)
|
||||||
|
)
|
||||||
|
.groupBy(getFormattedDate(member.createdAt))
|
||||||
|
.orderBy(getFormattedDate(member.createdAt).desc())
|
||||||
|
.fetch()
|
||||||
|
}
|
||||||
|
|
||||||
fun getSignUpLineCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
fun getSignUpLineCountInRange(startDate: LocalDateTime, endDate: LocalDateTime): List<DateAndMemberCount> {
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ class AdminMemberStatisticsService(private val repository: AdminMemberStatistics
|
|||||||
startDate = startDateTime,
|
startDate = startDateTime,
|
||||||
endDate = endDateTime
|
endDate = endDateTime
|
||||||
)
|
)
|
||||||
|
val totalSignUpAppleCount = repository.getTotalSignUpAppleCount(
|
||||||
|
startDate = startDateTime,
|
||||||
|
endDate = endDateTime
|
||||||
|
)
|
||||||
val totalSignUpLineCount = repository.getTotalSignUpLineCount(
|
val totalSignUpLineCount = repository.getTotalSignUpLineCount(
|
||||||
startDate = startDateTime,
|
startDate = startDateTime,
|
||||||
endDate = endDateTime
|
endDate = endDateTime
|
||||||
@@ -96,6 +100,11 @@ class AdminMemberStatisticsService(private val repository: AdminMemberStatistics
|
|||||||
endDate = endDateTime
|
endDate = endDateTime
|
||||||
).associateBy({ it.date }, { it.memberCount })
|
).associateBy({ it.date }, { it.memberCount })
|
||||||
|
|
||||||
|
val signUpAppleCountInRange = repository.getSignUpAppleCountInRange(
|
||||||
|
startDate = startDateTime,
|
||||||
|
endDate = endDateTime
|
||||||
|
).associateBy({ it.date }, { it.memberCount })
|
||||||
|
|
||||||
val signUpLineCountInRange = repository.getSignUpLineCountInRange(
|
val signUpLineCountInRange = repository.getSignUpLineCountInRange(
|
||||||
startDate = startDateTime,
|
startDate = startDateTime,
|
||||||
endDate = endDateTime
|
endDate = endDateTime
|
||||||
@@ -130,6 +139,7 @@ class AdminMemberStatisticsService(private val repository: AdminMemberStatistics
|
|||||||
signUpEmailCount = signUpEmailCountInRange[date] ?: 0,
|
signUpEmailCount = signUpEmailCountInRange[date] ?: 0,
|
||||||
signUpKakaoCount = signUpKakaoCountInRange[date] ?: 0,
|
signUpKakaoCount = signUpKakaoCountInRange[date] ?: 0,
|
||||||
signUpGoogleCount = signUpGoogleCountInRange[date] ?: 0,
|
signUpGoogleCount = signUpGoogleCountInRange[date] ?: 0,
|
||||||
|
signUpAppleCount = signUpAppleCountInRange[date] ?: 0,
|
||||||
signUpLineCount = signUpLineCountInRange[date] ?: 0,
|
signUpLineCount = signUpLineCountInRange[date] ?: 0,
|
||||||
signOutCount = signOutCountInRange[date] ?: 0,
|
signOutCount = signOutCountInRange[date] ?: 0,
|
||||||
paymentMemberCount = paymentMemberCountInRangeMap[date] ?: 0
|
paymentMemberCount = paymentMemberCountInRangeMap[date] ?: 0
|
||||||
@@ -144,6 +154,7 @@ class AdminMemberStatisticsService(private val repository: AdminMemberStatistics
|
|||||||
totalSignUpEmailCount = totalSignUpEmailCount,
|
totalSignUpEmailCount = totalSignUpEmailCount,
|
||||||
totalSignUpKakaoCount = totalSignUpKakaoCount,
|
totalSignUpKakaoCount = totalSignUpKakaoCount,
|
||||||
totalSignUpGoogleCount = totalSignUpGoogleCount,
|
totalSignUpGoogleCount = totalSignUpGoogleCount,
|
||||||
|
totalSignUpAppleCount = totalSignUpAppleCount,
|
||||||
totalSignUpLineCount = totalSignUpLineCount,
|
totalSignUpLineCount = totalSignUpLineCount,
|
||||||
totalSignOutCount = totalSignOutCount,
|
totalSignOutCount = totalSignOutCount,
|
||||||
totalPaymentMemberCount = totalPaymentMemberCount,
|
totalPaymentMemberCount = totalPaymentMemberCount,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ data class GetMemberStatisticsResponse(
|
|||||||
val totalSignUpEmailCount: Int,
|
val totalSignUpEmailCount: Int,
|
||||||
val totalSignUpKakaoCount: Int,
|
val totalSignUpKakaoCount: Int,
|
||||||
val totalSignUpGoogleCount: Int,
|
val totalSignUpGoogleCount: Int,
|
||||||
|
val totalSignUpAppleCount: Int,
|
||||||
val totalSignUpLineCount: Int,
|
val totalSignUpLineCount: Int,
|
||||||
val totalSignOutCount: Int,
|
val totalSignOutCount: Int,
|
||||||
val totalPaymentMemberCount: Int,
|
val totalPaymentMemberCount: Int,
|
||||||
@@ -20,6 +21,7 @@ data class GetMemberStatisticsItem(
|
|||||||
val signUpEmailCount: Int,
|
val signUpEmailCount: Int,
|
||||||
val signUpKakaoCount: Int,
|
val signUpKakaoCount: Int,
|
||||||
val signUpGoogleCount: Int,
|
val signUpGoogleCount: Int,
|
||||||
|
val signUpAppleCount: Int,
|
||||||
val signUpLineCount: Int,
|
val signUpLineCount: Int,
|
||||||
val signOutCount: Int,
|
val signOutCount: Int,
|
||||||
val paymentMemberCount: Int
|
val paymentMemberCount: Int
|
||||||
|
|||||||
Reference in New Issue
Block a user