2026-03-21 02:55:24 +08:00
|
|
|
<?php
|
|
|
|
|
// +----------------------------------------------------------------------
|
2026-03-29 11:22:52 +08:00
|
|
|
// | Author: ScottPan Team
|
2026-03-21 02:55:24 +08:00
|
|
|
// +----------------------------------------------------------------------
|
2026-03-29 11:22:52 +08:00
|
|
|
|
2026-03-21 02:55:24 +08:00
|
|
|
namespace app\validate\api\user;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use think\Validate;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 注册验证
|
|
|
|
|
* Class UserApplyValidate
|
|
|
|
|
* @package app\http\validates\api\user
|
|
|
|
|
*/
|
|
|
|
|
class UserApplyValidate extends Validate
|
|
|
|
|
{
|
|
|
|
|
protected $regex = ['phone' => '/^1[3456789]\d{9}$/'];
|
|
|
|
|
|
|
|
|
|
protected $rule = [
|
|
|
|
|
'phone' => 'require|regex:phone',
|
|
|
|
|
'name' => 'require|length:2,20',
|
|
|
|
|
'system_name' => 'require|length:4,64',
|
|
|
|
|
'images' => 'require'
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $message = [
|
|
|
|
|
'phone.require' => '手机号必须填写',
|
|
|
|
|
'phone.regex' => '手机号格式错误',
|
|
|
|
|
'name.require' => '联系人必须填写',
|
|
|
|
|
'name.length' => '联系人2-20长度字符',
|
|
|
|
|
'captcha.require' => '验证码必须填写',
|
|
|
|
|
'captcha.length' => '验证码长度不正确',
|
|
|
|
|
'system_name.require' => '商户名称必须填写',
|
|
|
|
|
'system_name.length' => '商户名称4-64长度字符',
|
|
|
|
|
'images.require' => '请上传相关资质证明图片',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
}
|