You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1011 B
40 lines
1011 B
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\validate;
|
|
|
|
use think\Validate;
|
|
|
|
class Agent extends Validate
|
|
{
|
|
/**
|
|
* 定义验证规则
|
|
* 格式:'字段名' => ['规则1','规则2'...]
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $rule = [
|
|
'user_id|用户id' => 'require|number',
|
|
'quota|额度' => 'require|number|egt:1',
|
|
'password|密码' => 'require|min:6|max:20',
|
|
'repassword|确认密码' => 'require|confirm:password',
|
|
'aid|代理id' => 'require|number',
|
|
'phone|手机号' => 'require|mobile',
|
|
];
|
|
|
|
/**
|
|
* 定义错误信息
|
|
* 格式:'字段名.规则名' => '错误信息'
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $message = [];
|
|
|
|
protected $scene = [
|
|
'scores' => ['user_id','quota'],
|
|
'edit' => ['aid','password'],
|
|
'del' => ['aid'],
|
|
'register' => ['phone','password'],
|
|
'modifyPassword' => ['password','repassword'],
|
|
];
|
|
}
|
|
|