feat:material

This commit is contained in:
LAPTOP-7SGDREK0\shiweijun
2025-01-22 11:19:10 +08:00
parent 1ea3880630
commit 63c3574c5f
10 changed files with 124 additions and 13 deletions

View File

@@ -36,9 +36,9 @@ class MaterialRequest extends FormRequest
}
protected array $scenes = [
'list' => ['limit','query_name'],
'add' => ['category_id', 'name', 'standard', 'unit', 'bar_code', 'city_id', 'kitchen_id'],
'edit' => ['id','category_id', 'name', 'standard', 'unit', 'bar_code','status'],
'delete' => ['id'],
'material_list' => ['limit','query_name'],
'material_add' => ['category_id', 'name', 'standard', 'unit', 'bar_code', 'city_id', 'kitchen_id'],
'material_edit' => ['id','category_id', 'name', 'standard', 'unit', 'bar_code','status'],
'material_delete' => ['id'],
];
}

View File

@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
namespace App\Request\Api;
use Hyperf\Validation\Request\FormRequest;
class MaterialRequest 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 [
'limit' => 'required|integer',
'query_name' =>'sometimes|string',
];
}
protected array $scenes = [
'material_list' => ['limit','query_name'],
];
}