fix:거래처코드 검색을 고유번호(id) 기반으로 변경

- Client::searchByCodeOrName → searchByIdOrName으로 변경
- 검색 기준: id(숫자일 때 정확 매칭) + name(LIKE 검색)
- 반환값: client_code 대신 id를 code로 반환

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-19 21:25:08 +09:00
parent 072268a1cf
commit 69f117ef8e
2 changed files with 10 additions and 8 deletions

View File

@@ -951,12 +951,12 @@ public function searchClients(Request $request): JsonResponse
]);
}
$clients = Client::searchByCodeOrName($tenantId, $keyword);
$clients = Client::searchByIdOrName($tenantId, $keyword);
return response()->json([
'success' => true,
'data' => $clients->map(fn($c) => [
'code' => $c->client_code,
'code' => (string) $c->id,
'name' => $c->name,
])
]);