feat:material material_category

This commit is contained in:
LAPTOP-7SGDREK0\shiweijun
2025-01-21 17:16:37 +08:00
parent 6b38a6b732
commit 9eebcd008f
10 changed files with 645 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace App\Request\Admin;
use Hyperf\Validation\Request\FormRequest;
class MaterialCategoryRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'query_id' =>'required|integer|exists:material_category,id',
'id' =>'required|integer',
'name' =>'required|string',
'parent_id' =>'sometimes|integer|exists:material_category,id',
'city_id' =>'required|integer|exists:system_city,id',
'kitchen_id' =>'required|integer|exists:kitchen,id',
];
}
protected array $scenes = [
'material_category_info' => ['query_id'],
'add' => ['name', 'parent_id', 'city_id', 'kitchen_id'],
'edit' => ['id','name', 'parent_id', 'city_id', 'kitchen_id'],
'delete' => ['id'],
];
}