feat:문서양식 목록에 연결 품목 컬럼 추가
- DocumentTemplateApiController: 연결 품목 ID로 품목명 조회 - table.blade.php: 연결 품목 컬럼 추가 (최대 3개 표시 + 더보기) - index.blade.php: 카테고리 필터 code/name 구조 적용 - preview-modal.blade.php: 기본필드 테이블 비율 조정 (15:35:15:35) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -61,7 +61,16 @@ public function index(Request $request): View
|
||||
$templates = $query->orderBy('updated_at', 'desc')
|
||||
->paginate($request->input('per_page', 10));
|
||||
|
||||
return view('document-templates.partials.table', compact('templates', 'showTrashed'));
|
||||
// 연결된 품목 ID 수집 및 품목명 조회
|
||||
$allItemIds = $templates->pluck('linked_item_ids')->flatten()->filter()->unique()->values()->toArray();
|
||||
$itemNames = [];
|
||||
if (! empty($allItemIds)) {
|
||||
$itemNames = \App\Models\Items\Item::whereIn('id', $allItemIds)
|
||||
->pluck('name', 'id')
|
||||
->toArray();
|
||||
}
|
||||
|
||||
return view('document-templates.partials.table', compact('templates', 'showTrashed', 'itemNames'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user