36 lines
678 B
PHP
36 lines
678 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request;
|
|
|
|
use Hyperf\Validation\Request\FormRequest;
|
|
|
|
class DoctorPharmacyRequest extends FormRequest
|
|
{
|
|
protected array $scenes = [
|
|
'setDefault' => ['pharmacy_id'],
|
|
'bindPharmacy' => ['pharmacy_id'],
|
|
];
|
|
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'pharmacy_id' => 'required|numeric',
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'pharmacy_id.required' => '药房ID不能为空',
|
|
'pharmacy_id.numeric' => '药房ID必须为数字',
|
|
];
|
|
}
|
|
}
|