| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace App\Module\Transaction\Validations;
- use App\Module\Transaction\Validators\InProgress;
- use UCore\ValidationCore;
- use UCore\Validator\IsUserAddress;
- class RechargeValidation extends ValidationCore
- {
- public function rules($rules = []): array
- {
- $rules = [
- [
- 'userId,addressId', 'required'
- ],
- [
- 'userId,addressId',
- new IsUserAddress($this),
- 'msg' => '地址不属于该用户'
- ],
- [
- 'addressId',
- new InProgress($this),
- 'msg' => '该地址有正在进行中的充值单,请稍后再试'
- ]
- ];
- return parent::rules($rules);
- }
- }
|