feat : section

This commit is contained in:
2024-11-07 16:17:57 +08:00
parent 7fd07c55d8
commit b6b2627129
11 changed files with 531 additions and 3 deletions

View File

@@ -22,7 +22,7 @@ class LoginRequest extends FormRequest
public function rules(): array
{
return [
'account' => 'required|digits:11',
'account' => 'required|string|digits:11',
'password' => 'required|string|min:6',
];
}

View File

@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
namespace App\Request\Admin;
use Hyperf\Validation\Request\FormRequest;
class SectionRequest 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 [
'id' => 'required|integer',
'name' => 'required|string',
'city_id' => 'exists:system_city,id',
'pid' => 'exists:admin_section,id',
'status' => 'in:1,2',
];
}
public function messages(): array
{
return [
];
}
protected array $scenes = [
'add' => ['name', 'city_id', 'status','pid'],
'edit' => ['name', 'city_id', 'status','pid','id'],
];
}