UserAddress.php 516 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Module\Ulogic\Validation;
  3. use UCore\ValidationCore;
  4. use UCore\Validator\isUserAddress;
  5. class UserAddress extends ValidationCore
  6. {
  7. public function rules($rules = []): array
  8. {
  9. $rules = [
  10. [
  11. 'userId,addressId', 'required'
  12. ],
  13. [
  14. 'userId,addressId',
  15. new isUserAddress($this),
  16. 'msg' => '地址不属于该用户'
  17. ]
  18. ];
  19. return parent::rules($rules);
  20. }
  21. }