From b292a9813628801f82f26532cf2dbb6abedab03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Fri, 27 Feb 2026 09:42:58 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[payroll]=20tenant=5Fid=20null=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - session('selected_tenant_id')에 기본값 1 추가 - PayrollSetting::getOrCreate, scopeForTenant 수정 - PayrollService 전체 tenant_id 조회에 기본값 적용 - Payroll 모델 scopeForTenant 동일 패턴 적용 --- app/Models/HR/PayrollSetting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/HR/PayrollSetting.php b/app/Models/HR/PayrollSetting.php index f2871aa8..30dba1cc 100644 --- a/app/Models/HR/PayrollSetting.php +++ b/app/Models/HR/PayrollSetting.php @@ -62,7 +62,7 @@ class PayrollSetting extends Model public function scopeForTenant($query, ?int $tenantId = null) { - $tenantId = $tenantId ?? session('selected_tenant_id') ?? 1; + $tenantId = $tenantId ?? session('selected_tenant_id', 1); return $query->where('tenant_id', $tenantId); } @@ -73,7 +73,7 @@ public function scopeForTenant($query, ?int $tenantId = null) public static function getOrCreate(?int $tenantId = null): self { - $tenantId = $tenantId ?? session('selected_tenant_id') ?? 1; + $tenantId = $tenantId ?? session('selected_tenant_id', 1); return self::firstOrCreate( ['tenant_id' => $tenantId],