From 51b23adcfe252609713415d8665c7e2804fb9dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Tue, 27 Jan 2026 21:10:50 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=98=A4=EB=8A=98=EC=9D=98=20=EC=9D=B4?= =?UTF-8?q?=EC=8A=88=20=EC=98=A4=EB=8A=98=20=EB=82=A0=EC=A7=9C=EB=A7=8C=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - TodayIssue 모델에 scopeToday() 스코프 추가 - TodayIssueService::summary()에 오늘 날짜 필터 적용 - 전체 개수 계산에도 오늘 날짜 필터 적용 Co-Authored-By: Claude --- app/Models/Tenants/TodayIssue.php | 8 ++++++++ app/Services/TodayIssueService.php | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/Models/Tenants/TodayIssue.php b/app/Models/Tenants/TodayIssue.php index 4aa2165..9b9dc00 100644 --- a/app/Models/Tenants/TodayIssue.php +++ b/app/Models/Tenants/TodayIssue.php @@ -128,6 +128,14 @@ public function scopeActive($query) }); } + /** + * 오늘 날짜 이슈 스코프 + */ + public function scopeToday($query) + { + return $query->whereDate('created_at', today()); + } + /** * 뱃지별 필터 스코프 */ diff --git a/app/Services/TodayIssueService.php b/app/Services/TodayIssueService.php index 92bf15e..d703bc1 100644 --- a/app/Services/TodayIssueService.php +++ b/app/Services/TodayIssueService.php @@ -25,6 +25,7 @@ public function summary(int $limit = 30, ?string $badge = null): array $query = TodayIssue::query() ->where('tenant_id', $tenantId) ->active() // 만료되지 않은 이슈만 + ->today() // 오늘 날짜 이슈만 ->orderByDesc('created_at'); // 뱃지 필터 @@ -32,10 +33,11 @@ public function summary(int $limit = 30, ?string $badge = null): array $query->byBadge($badge); } - // 전체 개수 (필터 적용 전) + // 전체 개수 (필터 적용 전, 오늘 날짜만) $totalQuery = TodayIssue::query() ->where('tenant_id', $tenantId) - ->active(); + ->active() + ->today(); $totalCount = $totalQuery->count(); // 결과 조회