fix: 오늘의 이슈 오늘 날짜만 표시하도록 수정

- TodayIssue 모델에 scopeToday() 스코프 추가
- TodayIssueService::summary()에 오늘 날짜 필터 적용
- 전체 개수 계산에도 오늘 날짜 필터 적용

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-01-27 21:10:50 +09:00
parent 7bd296b2fa
commit 51b23adcfe
2 changed files with 12 additions and 2 deletions

View File

@@ -128,6 +128,14 @@ public function scopeActive($query)
});
}
/**
* 오늘 날짜 이슈 스코프
*/
public function scopeToday($query)
{
return $query->whereDate('created_at', today());
}
/**
* 뱃지별 필터 스코프
*/

View File

@@ -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();
// 결과 조회