From 3ca2a36fa891b265753ea9abde38836db6cdbb02 Mon Sep 17 00:00:00 2001 From: Yu Sung Date: Mon, 17 Mar 2025 13:51:54 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B4=91=EA=B3=A0=ED=86=B5=EA=B3=84=20-=20?= =?UTF-8?q?=EB=B9=A0=EB=A5=B8=EA=B2=80=EC=83=89=20(=EB=82=A0=EC=A7=9C=20?= =?UTF-8?q?=EC=A7=80=EC=A0=95)=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Marketing/MarketingAdStatisticsView.vue | 96 ++++++++++++++----- 1 file changed, 71 insertions(+), 25 deletions(-) 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() + } }, }