diff --git a/src/views/Marketing/MarketingAdStatisticsView.vue b/src/views/Marketing/MarketingAdStatisticsView.vue index 304912c..31d383d 100644 --- a/src/views/Marketing/MarketingAdStatisticsView.vue +++ b/src/views/Marketing/MarketingAdStatisticsView.vue @@ -11,19 +11,51 @@ - + + + 오늘 + + + + + 어제 + + + + + 7일 전 + + + + - ~ - - + - - a + (b[key] || 0), 0) }, + formatDate(date) { + return date.toISOString().split('T')[0]; + }, + async next() { await this.getStatistics() }, @@ -293,6 +309,36 @@ export default { this.is_loading = false } }, + + async getTodayStatistics() { + const today = new Date(); + + this.start_date = this.formatDate(today); + this.end_date = this.formatDate(today); + + await this.getStatistics() + }, + + async getYesterdayStatistics() { + const yesterday = new Date(); + yesterday.setDate(yesterday.getDate() - 1); + + this.start_date = this.formatDate(yesterday); + this.end_date = this.formatDate(yesterday); + await this.getStatistics() + }, + + async getWeekStatistics() { + const week = new Date(); + week.setDate(week.getDate() - 8); + + const yesterday = new Date(); + yesterday.setDate(yesterday.getDate() - 1); + + this.start_date = this.formatDate(week); + this.end_date = this.formatDate(yesterday); + await this.getStatistics() + } }, }