diff --git a/app/Request/Admin/MaterialCategoryRequest.php b/app/Request/Admin/MaterialCategoryRequest.php index 2d77fd8..790b350 100644 --- a/app/Request/Admin/MaterialCategoryRequest.php +++ b/app/Request/Admin/MaterialCategoryRequest.php @@ -37,6 +37,6 @@ class MaterialCategoryRequest extends FormRequest 'add' => ['name', 'parent_id', 'city_id', 'kitchen_id'], 'edit' => ['id','name', 'parent_id'], 'delete' => ['id'], - 'list' => ['query_city_id'], + 'list' => ['city_id'], ]; } diff --git a/app/Service/Admin/Material/MaterialCategoryService.php b/app/Service/Admin/Material/MaterialCategoryService.php index 5946ab1..a3a1154 100644 --- a/app/Service/Admin/Material/MaterialCategoryService.php +++ b/app/Service/Admin/Material/MaterialCategoryService.php @@ -105,12 +105,10 @@ class MaterialCategoryService extends BaseService{ */ public function list(): array { - $cityId = (int)$this->request->input('query_city_id'); + $cityId = (int)$this->request->input('city_id'); $list = $this->MaterialCategoryModel - ->when($cityId > 0,function($query) use($cityId){ - $query->where('city_id',$cityId); - }) + ->where('city_id',$cityId) ->where('is_del',MaterialCode::IS_NO_DEL)->get()->toArray(); $tree = [];