Files
hyperf_service/app/Request/Admin/MaterialRequest.php
LAPTOP-7SGDREK0\shiweijun 51710eae96 fix:dish material
2025-02-24 16:52:26 +08:00

48 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Request\Admin;
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',
'id' =>'required|integer',
'category_id' =>'required|integer|exists:material_category,id',
'name' =>'required|string',
'standard' =>'string',
'unit' =>'string',
'bar_code' =>'string',
'city_id' =>'required|integer|exists:system_city,id',
'kitchen_id' =>'required|integer|exists:kitchen,id',
];
}
protected array $scenes = [
'material_list' => ['limit','query_name','query_kitchen_id'],
'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'],
'materialStock_list' => ['limit','query_name','query_materialId','query_depotId','query_supplierId','query_kitchenId'],
'materialStock_edit' => ['id', 'current_stock', 'unit_price'],
'chef_cost_list' => ['limit','chef_name','date','query_kitchen_id'],
];
}