<?php
namespace app\http\validates\user;


use think\Validate;

/**
 * 注册验证
 * Class RegisterValidates
 * @package app\http\validates\user
 */
class UserValidates extends Validate
{

    protected $rule = [
        'rname'  =>  'require',
        'cid'  =>  'require|idCard',
        'cidimg'  =>  'require',
    ];

    protected $message  =   [
        'rname.require'     =>  '姓名必须填写',
        'cid.require'     =>  '身份证必须填写',
        'cidimg.require'     =>  '身份证图片必须上传',
        'cid.idCard' => '身份证格式不对'

    ];


    public function sceneCode()
    {
        return $this->only(['phone']);
    }


    public function sceneRegister()
    {
        return $this->only(['account','captcha','password']);
    }
}