<?php

namespace app\admin\validate\medical;

use support\Validate;

class DoctorValidate extends Validate
{
    protected $rule = [
        'doctor_id' => 'require|integer',
        'doctor_name|姓名' => 'require',
        'doctor_position|职位' => 'require',
        'doctor_avatar|头像' => 'require|url',
        'doctor_mobile|联系电话' => 'mobile',
        'doctor_is_visit|是否出诊' => 'require|in:0,1',
        'doctor_price|收费标准' => 'require|float',
        'doctor_type|类型' => 'require|in:0,1,2',
        'doctor_on_line|是否支持在线沟通' => 'require|in:0,1',
//        'doctor_shop_id' => 'require|integer',
        'doctor_subject_id' => 'require|integer',
        'doctor_status|医生状态' => 'in:0,1'
    ];

    protected $message = [];

    protected $scene = [
        'add' => ['doctor_name', 'doctor_position', 'doctor_avatar', 'doctor_mobile', 'doctor_is_visit', 'doctor_price',
            'doctor_type', 'doctor_on_line', 'doctor_subject_id', 'doctor_status'],
        'update' => ['doctor_id', 'doctor_name', 'doctor_position', 'doctor_avatar', 'doctor_mobile', 'doctor_is_visit', 'doctor_price',
            'doctor_type', 'doctor_on_line', 'doctor_subject_id', 'doctor_status'],
        'info' => ['doctor_id']
    ];
}