12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace app\admin\validate\package;
- use think\Validate;
- class DoctorValidate extends Validate
- {
- protected $rule = [
- 'doctor_id' => 'require',
- 'doctor_name' => 'require',
- 'doctor_position' => 'require',
- 'doctor_head' => 'require',
- 'doctor_phone' => 'require',
- 'doctor_info' => 'require',
- 'doctor_visit' => 'require',
- 'doctor_visit_time' => 'require',
- 'doctor_work' => 'require',
- 'doctor_money' => 'require',
- 'doctor_shop_id' => 'require',
- 'doctor_subject_id' => 'require',
- 'doctor_address' => 'require',
- 'doctor_status' => 'require',
- ];
- protected $message = [
- 'doctor_name.require' => '医生名称不能为空',
- 'doctor_position.require' => '医生职位不能为空',
- 'doctor_head.require' => '头像不能为空',
- 'doctor_phone.require' => '手机号不能为空',
- 'doctor_info.require' => '医生擅长技能不能为空',
- 'doctor_visit.require' => '价格不能为空',
- 'doctor_visit_time.require' => '出诊时间不能为空',
- 'doctor_work.require' => '上班时间不能为空',
- 'doctor_money.require' => '标准费用不能为空',
- 'doctor_shop_id.require' => '所属医疗店铺不能为空',
- 'doctor_subject_id.require' => '科目编号不能为空',
- 'doctor_address.require' => '科室地点不能为空',
- 'doctor_status.require' => '医生状态不能为空',
- ];
- //场景
- protected $scene = [
- 'add' => [
- 'doctor_name','doctor_position','doctor_head',
- 'doctor_phone','doctor_phone','doctor_info',
- 'doctor_visit','doctor_visit_time',
- 'doctor_work','doctor_money','doctor_shop_id',
- 'doctor_subject_id','doctor_address','doctor_status'
- ],
- 'update' => [
- 'doctor_id','doctor_name','doctor_position','doctor_head',
- 'doctor_phone','doctor_phone','doctor_info',
- 'doctor_visit','doctor_visit_time',
- 'doctor_work','doctor_money','doctor_shop_id',
- 'doctor_subject_id','doctor_address','doctor_status'
- ],
- 'info' => ['doctor_id'],
- 'del' => ['doctor_id']
- ];
- }
|