| 
									
										
										
										
											2021-11-18 17:57:04 +08:00
										 |  |  | <?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', | 
					
						
							| 
									
										
										
										
											2022-03-21 18:15:24 +08:00
										 |  |  |        // 'real_name|真实姓名'   => 'require',
 | 
					
						
							| 
									
										
										
										
											2021-11-18 17:57:04 +08:00
										 |  |  |         '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'], //绑定手机号
 | 
					
						
							|  |  |  |     ]; | 
					
						
							|  |  |  | } |