| 12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace App\Module\Sms\Validation;
- use App\Module\User\Validator\IsNotRegister;
- use UCore\ValidationCore;
- use UCore\Validator\PhoneValidator;
- /**
- * 注册发送短信验证
- */
- class CheckPhone extends ValidationCore
- {
- public function rules($rules = []): array
- {
- $rules = [
- [
- 'mobile', 'required'
- ],
- [
- 'mobile',
- new PhoneValidator($this),
- 'msg' => '不存在的手机号码'
- ],
- [
- 'mobile',
- new IsNotRegister($this),
- 'msg' => '该手机号已注册'
- ]
- ];
- return parent::rules($rules);
- }
- }
|