fix: [pricing] 단가 목록/상세에서 품목코드·품목명 미표시 수정

- Price 모델에 item() BelongsTo 관계 추가
- index/show에서 item:id,code,name,item_category eager load
This commit is contained in:
2026-03-19 23:58:02 +09:00
parent bb4d9d8fbd
commit fc673be0c1
2 changed files with 10 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ public function index(array $params): LengthAwarePaginator
$validAt = $params['valid_at'] ?? null;
$query = Price::query()
->with(['clientGroup:id,name'])
->with(['clientGroup:id,name', 'item:id,code,name,item_category'])
->where('tenant_id', $tenantId);
// 검색어 필터
@@ -81,7 +81,7 @@ public function show(int $id): Price
$tenantId = $this->tenantId();
$price = Price::query()
->with(['clientGroup:id,name', 'revisions' => function ($q) {
->with(['clientGroup:id,name', 'item:id,code,name,item_category', 'revisions' => function ($q) {
$q->orderByDesc('revision_number')->limit(10);
}])
->where('tenant_id', $tenantId)