32 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
		
		
			
		
	
	
			32 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
|  | <?php | ||
|  | 
 | ||
|  | namespace app\validate; | ||
|  | 
 | ||
|  | use think\Validate; | ||
|  | 
 | ||
|  | class Account extends Validate | ||
|  | { | ||
|  |     protected $rule = [ | ||
|  |         'phone|手机号'             => 'require|mobile', | ||
|  |         'old_password|旧密码'      => 'require|length:6,16', | ||
|  |         'password|密码'           => 'require|length:6,16', | ||
|  |         'confirm_password|确认密码' => 'require|confirm:password|length:6,16', | ||
|  |         'password_confirm|确认密码' => 'require|confirm:password|length:6,16', | ||
|  |         'code|验证码'              => 'require|number|length:6', | ||
|  |         'type|类型'               => 'require', | ||
|  |         'username|用户名'          => 'require|min:4', | ||
|  | 
 | ||
|  |         'id_card|身份证'      => 'require', | ||
|  |         'real_name|真实姓名'   => 'require', | ||
|  |         'bank_number|银行卡号' => 'require', | ||
|  |         'bank_name|银行名称'   => 'require', | ||
|  |     ]; | ||
|  | 
 | ||
|  |     protected $scene = [ | ||
|  |         'edit_password' => ['old_password', 'password', 'confirm_password'], //修改密码
 | ||
|  |         'register'      => ['username', 'nickname', 'phone', 'password', 'password_confirm', 'code'], //注册
 | ||
|  |         'send_sms'      => ['phone', 'type'], //发送短信
 | ||
|  |         'binding'       => ['phone', 'code'], //绑定手机号
 | ||
|  |         'real_name'     => ['id_card', 'real_name', 'bank_number', 'bank_name'], //实名认证
 | ||
|  |     ]; | ||
|  | } |