feat(WEB): 절곡품 선생산→재고적재 Phase 2 - 품목 카테고리 필터 추가
- StockController: item_category 파라미터 수용 - StockService: items.item_category 기반 필터링 로직 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,7 @@ public function index(Request $request): JsonResponse
|
||||
$params = $request->only([
|
||||
'search',
|
||||
'item_type',
|
||||
'item_category',
|
||||
'status',
|
||||
'location',
|
||||
'sort_by',
|
||||
|
||||
@@ -69,6 +69,11 @@ public function index(array $params): LengthAwarePaginator
|
||||
$query->where('items.item_type', strtoupper($params['item_type']));
|
||||
}
|
||||
|
||||
// 품목 카테고리 필터 (Item.item_category: BENDING, SCREEN, STEEL 등)
|
||||
if (! empty($params['item_category'])) {
|
||||
$query->where('items.item_category', strtoupper($params['item_category']));
|
||||
}
|
||||
|
||||
// 재고 상태 필터 (Stock.status)
|
||||
if (! empty($params['status'])) {
|
||||
$query->whereHas('stock', function ($q) use ($params) {
|
||||
|
||||
Reference in New Issue
Block a user