IsOnlineAddress.php 542 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace UCore\Validator;
  3. use App\Module\Ulogic\Services\UserAddressService;
  4. use UCore\Validator;
  5. class IsOnlineAddress extends Validator
  6. {
  7. /**
  8. * @param mixed $value
  9. * @param array $data
  10. * @return bool
  11. * 检测是否uraus地址
  12. */
  13. public function validate(mixed $value, array $data): bool
  14. {
  15. $sysStr = '0xuraus';
  16. $prefix = substr($data['to_address'], 0, 7); // 截取前 7 位
  17. if ($sysStr === $prefix) {
  18. return false;
  19. }
  20. return true;
  21. }
  22. }