From 4c09f2536e7be9537374666cad8db88830988e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Tue, 10 Feb 2026 21:11:11 +0900 Subject: [PATCH] =?UTF-8?q?feat:=EB=8B=AC=EB=A0=A5=20=EC=9D=BC=EC=A0=95?= =?UTF-8?q?=EC=97=90=20=EC=B2=A8=EB=B6=80=ED=8C=8C=EC=9D=BC=20=EC=95=84?= =?UTF-8?q?=EC=9D=B4=EC=BD=98=20=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DashboardCalendarController.php | 1 + app/Models/System/Schedule.php | 7 +++++++ .../dashboard/partials/calendar.blade.php | 19 +++++++++++++------ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/DashboardCalendarController.php b/app/Http/Controllers/DashboardCalendarController.php index e71bf6b4..69785492 100644 --- a/app/Http/Controllers/DashboardCalendarController.php +++ b/app/Http/Controllers/DashboardCalendarController.php @@ -33,6 +33,7 @@ public function calendar(Request $request): View $calendarData = Schedule::forTenant($tenantId) ->active() ->betweenDates($startOfWeek->toDateString(), $endOfWeek->toDateString()) + ->withCount('files') ->orderBy('start_date') ->orderBy('start_time') ->get() diff --git a/app/Models/System/Schedule.php b/app/Models/System/Schedule.php index a2ae3ec6..72568aff 100644 --- a/app/Models/System/Schedule.php +++ b/app/Models/System/Schedule.php @@ -2,6 +2,7 @@ namespace App\Models\System; +use App\Models\Boards\File; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; @@ -68,6 +69,12 @@ class Schedule extends Model self::TYPE_OTHER => ['bg' => 'bg-gray-50', 'text' => 'text-gray-700', 'border' => 'border-gray-200'], ]; + public function files() + { + return $this->hasMany(File::class, 'document_id') + ->where('document_type', 'schedule'); + } + public function scopeForTenant(Builder $query, int $tenantId): Builder { return $query->where(function ($q) use ($tenantId) { diff --git a/resources/views/dashboard/partials/calendar.blade.php b/resources/views/dashboard/partials/calendar.blade.php index 08e3b3c9..ca88d771 100644 --- a/resources/views/dashboard/partials/calendar.blade.php +++ b/resources/views/dashboard/partials/calendar.blade.php @@ -125,14 +125,21 @@ class="text-gray-300 hover:text-emerald-600 hover:bg-emerald-50 rounded transiti
@foreach($daySchedules as $schedule) @endforeach