feat:dish depot
This commit is contained in:
41
app/Request/Admin/DepotRequest.php
Normal file
41
app/Request/Admin/DepotRequest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Request\Admin;
|
||||
|
||||
use Hyperf\Validation\Request\FormRequest;
|
||||
|
||||
class DepotRequest 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_id' => 'sometimes|integer',
|
||||
'query_kitchen_id' => 'sometimes|integer',
|
||||
'name' => 'required|string',
|
||||
'city_id' => 'required|integer|exists:system_city,id',
|
||||
'kitchen_id' => 'required|integer|exists:kitchen,id',
|
||||
'id' => 'required|integer',
|
||||
];
|
||||
}
|
||||
|
||||
protected array $scenes = [
|
||||
'depot_list' => ['limit','query_id','query_kitchen_id'],
|
||||
'depot_add' => ['name','city_id','kitchen_id'],
|
||||
'depot_edit' => ['id','name','city_id','kitchen_id'],
|
||||
'depot_delete' => ['id'],
|
||||
];
|
||||
}
|
||||
39
app/Request/Admin/DishRequest.php
Normal file
39
app/Request/Admin/DishRequest.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Request\Admin;
|
||||
|
||||
use Hyperf\Validation\Request\FormRequest;
|
||||
|
||||
class DishRequest 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_id' => 'sometimes|integer',
|
||||
'query_dish_name' => 'sometimes|string',
|
||||
'query_city_id' => 'sometimes|integer|exists:system_city,id',
|
||||
'query_date_id' => 'sometimes|integer|exists:cycle,id',
|
||||
'query_status' => 'sometimes|integer',
|
||||
'query_chef_id' => 'sometimes|integer',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
protected array $scenes = [
|
||||
'list' => ['limit','query_id','query_dish_name','query_city_id','query_date_id','query_status','query_chef_id'],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user