UserIdExsit.php 396 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Module\User\Validator;
  3. use App\Module\User\Services\UserService;
  4. use UCore\Validator;
  5. /**
  6. * 用户ID是否存在,存在true
  7. *
  8. *
  9. */
  10. class UserIdExsit extends Validator
  11. {
  12. public function validate(mixed $value, array $data): bool
  13. {
  14. $info = UserService::info($value);
  15. if ($info) {
  16. return true;
  17. }
  18. return false;
  19. }
  20. }