From 847717e631b94746cc4a4522009732fa332a09b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Thu, 29 Jan 2026 15:04:55 +0900 Subject: [PATCH] =?UTF-8?q?feat(=EA=B1=B0=EB=9E=98=EC=B2=98):=20client=5Ft?= =?UTF-8?q?ype=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 - ClientService.index()에 client_type 파라미터 필터 추가 - 쉼표 구분 복수 값 지원 (예: PURCHASE,BOTH) - 매입 가능 거래처만 조회하는 용도 Co-Authored-By: Claude Opus 4.5 --- app/Services/ClientService.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Services/ClientService.php b/app/Services/ClientService.php index 6f44428..b3af238 100644 --- a/app/Services/ClientService.php +++ b/app/Services/ClientService.php @@ -21,6 +21,7 @@ public function index(array $params) $size = (int) ($params['size'] ?? 20); $q = trim((string) ($params['q'] ?? '')); $onlyActive = $params['only_active'] ?? null; + $clientType = $params['client_type'] ?? null; $query = Client::query()->where('tenant_id', $tenantId); @@ -36,6 +37,12 @@ public function index(array $params) $query->where('is_active', (bool) $onlyActive); } + // 거래처 유형 필터 (쉼표 구분 복수 값 지원: PURCHASE,BOTH) + if ($clientType !== null && $clientType !== '') { + $types = array_map('trim', explode(',', $clientType)); + $query->whereIn('client_type', $types); + } + $query->orderBy('client_code')->orderBy('id'); $paginator = $query->paginate($size, ['*'], 'page', $page);