From 5ebca1402d93b82bed1c1619231895866859abc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Sat, 28 Feb 2026 08:31:14 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[users]=20=EC=9E=AC=EC=A7=81/=ED=9C=B4?= =?UTF-8?q?=EC=A7=81/=ED=87=B4=EC=A7=81=20=EC=83=81=ED=83=9C=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=20=ED=95=84=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - index.blade.php에 employee_status 필터 select 추가 - UserService에 tenant_user_profiles 기반 필터링 로직 추가 --- app/Services/UserService.php | 14 +++++++++++++- resources/views/users/index.blade.php | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/app/Services/UserService.php b/app/Services/UserService.php index f68dd5e8..1132e5f0 100644 --- a/app/Services/UserService.php +++ b/app/Services/UserService.php @@ -77,10 +77,22 @@ public function getUsers(array $filters = [], int $perPage = 15): LengthAwarePag } // 활성 상태 필터 - if (isset($filters['is_active'])) { + if (isset($filters['is_active']) && $filters['is_active'] !== '') { $query->where('is_active', $filters['is_active']); } + // 재직상태 필터 (tenant_user_profiles.employee_status) + if (! empty($filters['employee_status']) && $tenantId) { + $status = $filters['employee_status']; + $query->whereExists(function ($sub) use ($tenantId, $status) { + $sub->select(DB::raw(1)) + ->from('tenant_user_profiles') + ->whereColumn('tenant_user_profiles.user_id', 'users.id') + ->where('tenant_user_profiles.tenant_id', $tenantId) + ->where('tenant_user_profiles.employee_status', $status); + }); + } + return $query->orderBy('created_at', 'desc')->paginate($perPage); } diff --git a/resources/views/users/index.blade.php b/resources/views/users/index.blade.php index 0dd9eabd..d409e6d4 100644 --- a/resources/views/users/index.blade.php +++ b/resources/views/users/index.blade.php @@ -22,10 +22,20 @@ class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"> + +
+ +
+ -
+