<?php
namespace app\admin\validate\medical;

use think\Validate;

class MentValidate extends Validate
{
    protected $rule =   [
        'appointment_id'               => 'require',
        'appointment_category_id'             => 'require',
        'appointment_shop_id'             => 'require',
        'appointment_name'            => 'require',
        'appointment_price'   => 'require',
        'appointment_type'             => 'require',
        'appointment_hour_count'          => 'require',
        'appointment_status'              => 'require',
    ];
    protected $message  =   [
        'appointment_id.require'               => '预约编号不能为空',
        'appointment_category_id.require'             => '关联分类编号不能为空',
        'appointment_shop_id.require'             => '关联商户编号 不能为空',
        'appointment_name.require'            => '预约名称',
        'appointment_price.require'   => '价格不能为空',
        'appointment_type.require'             => '是否支持预约不能为空',
        'appointment_hour_count.require'          => '每小时可预约人数不能为空',
        'appointment_status.require'              => '状态不能为空',
    ];
    //场景
    protected $scene = [
        'add'           => [
            'appointment_category_id','appointment_shop_id','appointment_name',
            'appointment_price','appointment_type','appointment_hour_count',
            'appointment_status',
            ],
        'update'        => [
            'appointment_category_id','appointment_shop_id','appointment_name',
            'appointment_price','appointment_type','appointment_hour_count',
            'appointment_status',  'appointment_id',
        ],
        'info'          => ['appointment_id'],
        'del'           => ['appointment_id']
    ];
}
