UserApplyValidate.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\validate\api\user;
  12. use think\Validate;
  13. /**
  14. * 注册验证
  15. * Class UserApplyValidate
  16. * @package app\http\validates\api\user
  17. */
  18. class UserApplyValidate extends Validate
  19. {
  20. protected $regex = ['phone' => '/^1[3456789]\d{9}$/'];
  21. protected $rule = [
  22. 'phone' => 'require|regex:phone',
  23. 'name' => 'require|length:2,20',
  24. 'captcha' => 'require|length:6',
  25. 'system_name' => 'require|length:4,64',
  26. 'images' => 'require'
  27. ];
  28. protected $message = [
  29. 'phone.require' => '手机号必须填写',
  30. 'phone.regex' => '手机号格式错误',
  31. 'name.require' => '联系人必须填写',
  32. 'name.length' => '联系人2-20长度字符',
  33. 'captcha.require' => '验证码必须填写',
  34. 'captcha.length' => '验证码长度不正确',
  35. 'system_name.require' => '商户名称必须填写',
  36. 'system_name.length' => '商户名称4-64长度字符',
  37. 'images.require' => '请上传相关资质证明图片',
  38. ];
  39. }