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

use think\Validate;

class HousekeeperValidate extends Validate
{
    //定义规则
    protected $rule =   [
        'housekeeper_name'      => 'require',
        'housekeeper_pwd'       => 'require',
        'housekeeper_real_name' => 'require',
        'housekeeper_phone'     => 'require',
        'housekeeper_position'  => 'require',
        'housekeeper_id'        => 'require'
    ];

    //定义描述
    protected $message  =   [
        'housekeeper_name.require' => '管家账号不能为空',
        'housekeeper_pwd.require'  => '管家密码不能为空',
        'housekeeper_real_name.require' => '管家真实姓名不能为空',
        'housekeeper_phone.require' => '管家手机号不能为空',
        'housekeeper_position.require' => '管家职位不能为空',
        'housekeeper_id.require'       => '管家编号不能为空'
    ];

    //定义场景
    protected $scene = [
        'add' => ['housekeeper_name','housekeeper_pwd', 'housekeeper_real_name', 'housekeeper_phone', 'housekeeper_position'],
        'up' => ['housekeeper_name','housekeeper_real_name', 'housekeeper_phone', 'housekeeper_position', 'housekeeper_id'],
        'info' => ['housekeeper_id'],
        'del'  => ['housekeeper_id']
    ];
}
