광고 통계 - 날짜 검색, 로그인 수 추가

This commit is contained in:
Yu Sung 2025-03-11 16:48:58 +09:00
parent 42492a7d55
commit 421e0b2b5f
2 changed files with 72 additions and 3 deletions

View File

@ -12,8 +12,8 @@ async function getMediaPartnerList(page) {
return Vue.axios.get("/admin/marketing/media-partner?page=" + (page - 1) + "&size=20") return Vue.axios.get("/admin/marketing/media-partner?page=" + (page - 1) + "&size=20")
} }
async function getStatistics(page) { async function getStatistics(startDate, endDate, page) {
return Vue.axios.get("/admin/marketing/statistics?page=" + (page - 1) + "&size=20") return Vue.axios.get("/admin/marketing/statistics?startDateStr=" + startDate + "&endDateStr=" + endDate + "&page=" + (page - 1) + "&size=20")
} }
export { export {

View File

@ -9,6 +9,42 @@
<br> <br>
<v-container> <v-container>
<v-row>
<v-spacer />
<v-col cols="2">
<datetime
v-model="start_date"
class="datepicker"
format="YYYY-MM-DD"
/>
</v-col>
<v-col cols="1">
~
</v-col>
<v-col cols="2">
<datetime
v-model="end_date"
class="datepicker"
format="YYYY-MM-DD"
/>
</v-col>
<v-col cols="1" />
<v-col cols="2">
<v-btn
block
color="#9970ff"
dark
depressed
@click="getStatistics"
>
조회
</v-btn>
</v-col>
</v-row>
<v-row> <v-row>
<v-col> <v-col>
<v-data-table <v-data-table
@ -24,6 +60,7 @@
<td colspan="4"> <td colspan="4">
총합계 총합계
</td> </td>
<td>{{ sumField('loginCount').toLocaleString() }}</td>
<td>{{ sumField('signUpCount').toLocaleString() }}</td> <td>{{ sumField('signUpCount').toLocaleString() }}</td>
<td>{{ sumField('firstPaymentCount').toLocaleString() }}</td> <td>{{ sumField('firstPaymentCount').toLocaleString() }}</td>
<td>{{ sumField('firstPaymentTotalAmount').toLocaleString() }}</td> <td>{{ sumField('firstPaymentTotalAmount').toLocaleString() }}</td>
@ -50,6 +87,10 @@
{{ item.pidName }} {{ item.pidName }}
</template> </template>
<template v-slot:item.loginCount="{ item }">
{{ item.loginCount.toLocaleString() }}
</template>
<template v-slot:item.signUpCount="{ item }"> <template v-slot:item.signUpCount="{ item }">
{{ item.signUpCount.toLocaleString() }} {{ item.signUpCount.toLocaleString() }}
</template> </template>
@ -96,13 +137,17 @@
<script> <script>
import * as api from "@/api/marketing"; import * as api from "@/api/marketing";
import datetime from "vuejs-datetimepicker";
export default { export default {
name: 'MarketingAdStatisticsView', name: 'MarketingAdStatisticsView',
components: {datetime},
data() { data() {
return { return {
is_loading: false, is_loading: false,
start_date: null,
end_date: null,
page: 1, page: 1,
total_page: 0, total_page: 0,
@ -131,6 +176,12 @@ export default {
sortable: false, sortable: false,
value: 'pidName', value: 'pidName',
}, },
{
text: '로그인 수',
align: 'center',
sortable: false,
value: 'loginCount',
},
{ {
text: '가입수', text: '가입수',
align: 'center', align: 'center',
@ -179,6 +230,24 @@ export default {
}, },
async created() { async created() {
const date = new Date();
const firstDate = new Date(date.getFullYear(), date.getMonth(), 1);
const lastDate = new Date(date.getFullYear(), date.getMonth() + 1, 0);
let firstDateMonth = (firstDate.getMonth() + 1).toString()
if (firstDateMonth.length < 2) {
firstDateMonth = '0' + firstDateMonth
}
let lastDateMonth = (lastDate.getMonth() + 1).toString()
if (lastDateMonth.length < 2) {
lastDateMonth = '0' + lastDateMonth
}
this.start_date = firstDate.getFullYear() + '-' + firstDateMonth + '-0' + firstDate.getDate()
this.end_date = lastDate.getFullYear() + '-' + lastDateMonth + '-' + lastDate.getDate()
await this.getStatistics() await this.getStatistics()
}, },
@ -203,7 +272,7 @@ export default {
this.is_loading = true this.is_loading = true
try { try {
const res = await api.getStatistics(this.page); const res = await api.getStatistics(this.start_date, this.end_date, this.page);
if (res.status === 200 && res.data.success === true) { if (res.status === 200 && res.data.success === true) {
let data = res.data.data let data = res.data.data