style: Pint 포맷팅 적용
This commit is contained in:
@@ -19,18 +19,22 @@ public function index(Request $request): JsonResponse
|
||||
if ($search = $request->input('search')) {
|
||||
$query->where(function ($q) use ($search) {
|
||||
$q->where('name', 'like', "%{$search}%")
|
||||
->orWhere('ceo', 'like', "%{$search}%")
|
||||
->orWhere('manager', 'like', "%{$search}%");
|
||||
->orWhere('ceo', 'like', "%{$search}%")
|
||||
->orWhere('manager', 'like', "%{$search}%");
|
||||
});
|
||||
}
|
||||
if ($status = $request->input('status')) {
|
||||
if ($status !== 'all') $query->where('status', $status);
|
||||
if ($status !== 'all') {
|
||||
$query->where('status', $status);
|
||||
}
|
||||
}
|
||||
if ($grade = $request->input('grade')) {
|
||||
if ($grade !== 'all') $query->where('grade', $grade);
|
||||
if ($grade !== 'all') {
|
||||
$query->where('grade', $grade);
|
||||
}
|
||||
}
|
||||
|
||||
$customers = $query->orderBy('created_at', 'desc')->get()->map(fn($item) => [
|
||||
$customers = $query->orderBy('created_at', 'desc')->get()->map(fn ($item) => [
|
||||
'id' => $item->id, 'name' => $item->name, 'bizNo' => $item->biz_no,
|
||||
'ceo' => $item->ceo, 'industry' => $item->industry, 'grade' => $item->grade,
|
||||
'contact' => $item->contact, 'email' => $item->email, 'address' => $item->address,
|
||||
@@ -90,6 +94,7 @@ public function destroy(int $id): JsonResponse
|
||||
{
|
||||
$tenantId = session('selected_tenant_id', 1);
|
||||
Customer::forTenant($tenantId)->findOrFail($id)->delete();
|
||||
|
||||
return response()->json(['success' => true, 'message' => '고객사가 삭제되었습니다.']);
|
||||
}
|
||||
|
||||
@@ -130,13 +135,14 @@ function ($attribute, $value, $fail) {
|
||||
return response()->json(['ok' => false, 'message' => $e->getMessage()], 500);
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('고객사 OCR 예상치 못한 오류', ['error' => $e->getMessage()]);
|
||||
|
||||
return response()->json(['ok' => false, 'message' => 'OCR 처리 중 오류가 발생했습니다.'], 500);
|
||||
}
|
||||
}
|
||||
|
||||
private function matchIndustry(string $bizType, string $bizItem): string
|
||||
{
|
||||
$text = $bizType . ' ' . $bizItem;
|
||||
$text = $bizType.' '.$bizItem;
|
||||
|
||||
$keywords = [
|
||||
'IT/소프트웨어' => ['소프트웨어', 'IT', '정보통신', '전산', '컴퓨터', '인터넷', '데이터', '프로그램'],
|
||||
@@ -162,8 +168,13 @@ private function buildCustomerMemo(array $raw): string
|
||||
$parts = [];
|
||||
$bizType = trim($raw['biz_type'] ?? '');
|
||||
$bizItem = trim($raw['biz_item'] ?? '');
|
||||
if ($bizType) $parts[] = "[업태] {$bizType}";
|
||||
if ($bizItem) $parts[] = "[종목] {$bizItem}";
|
||||
if ($bizType) {
|
||||
$parts[] = "[업태] {$bizType}";
|
||||
}
|
||||
if ($bizItem) {
|
||||
$parts[] = "[종목] {$bizItem}";
|
||||
}
|
||||
|
||||
return implode(' / ', $parts);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user