test #60
|
@ -12,8 +12,8 @@ async function getMediaPartnerList(page) {
|
|||
return Vue.axios.get("/admin/marketing/media-partner?page=" + (page - 1) + "&size=20")
|
||||
}
|
||||
|
||||
async function getStatistics(page) {
|
||||
return Vue.axios.get("/admin/marketing/statistics?page=" + (page - 1) + "&size=20")
|
||||
async function getStatistics(startDate, endDate, page) {
|
||||
return Vue.axios.get("/admin/marketing/statistics?startDateStr=" + startDate + "&endDateStr=" + endDate + "&page=" + (page - 1) + "&size=20")
|
||||
}
|
||||
|
||||
export {
|
||||
|
|
|
@ -9,6 +9,42 @@
|
|||
<br>
|
||||
|
||||
<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="#3bb9f1"
|
||||
dark
|
||||
depressed
|
||||
@click="getStatistics"
|
||||
>
|
||||
조회
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-data-table
|
||||
|
@ -24,6 +60,7 @@
|
|||
<td colspan="4">
|
||||
총합계
|
||||
</td>
|
||||
<td>{{ sumField('loginCount').toLocaleString() }}</td>
|
||||
<td>{{ sumField('signUpCount').toLocaleString() }}</td>
|
||||
<td>{{ sumField('firstPaymentCount').toLocaleString() }}</td>
|
||||
<td>{{ sumField('firstPaymentTotalAmount').toLocaleString() }}</td>
|
||||
|
@ -50,6 +87,10 @@
|
|||
{{ item.pidName }}
|
||||
</template>
|
||||
|
||||
<template v-slot:item.loginCount="{ item }">
|
||||
{{ item.loginCount.toLocaleString() }}
|
||||
</template>
|
||||
|
||||
<template v-slot:item.signUpCount="{ item }">
|
||||
{{ item.signUpCount.toLocaleString() }}
|
||||
</template>
|
||||
|
@ -96,13 +137,17 @@
|
|||
|
||||
<script>
|
||||
import * as api from "@/api/marketing";
|
||||
import datetime from "vuejs-datetimepicker";
|
||||
|
||||
export default {
|
||||
name: 'MarketingAdStatisticsView',
|
||||
components: {datetime},
|
||||
|
||||
data() {
|
||||
return {
|
||||
is_loading: false,
|
||||
start_date: null,
|
||||
end_date: null,
|
||||
page: 1,
|
||||
total_page: 0,
|
||||
|
||||
|
@ -131,6 +176,12 @@ export default {
|
|||
sortable: false,
|
||||
value: 'pidName',
|
||||
},
|
||||
{
|
||||
text: '로그인 수',
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
value: 'loginCount',
|
||||
},
|
||||
{
|
||||
text: '가입수',
|
||||
align: 'center',
|
||||
|
@ -179,6 +230,24 @@ export default {
|
|||
},
|
||||
|
||||
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()
|
||||
},
|
||||
|
||||
|
@ -203,7 +272,7 @@ export default {
|
|||
this.is_loading = true
|
||||
|
||||
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) {
|
||||
let data = res.data.data
|
||||
|
|
Loading…
Reference in New Issue