InProgress.php 607 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Module\Transaction\Validators;
  3. use App\Module\Transaction\Models\TransactionRecharge;
  4. use App\Module\Ulogic\Services\UserAddressService;
  5. use UCore\Validator;
  6. class InProgress extends Validator
  7. {
  8. /**
  9. * @param mixed $value
  10. * @param array $data
  11. * @return bool
  12. */
  13. public function validate(mixed $value, array $data): bool
  14. {
  15. $address = UserAddressService::getAddressById($value)->address;
  16. $data = TransactionRecharge::getOrderByFromAddress($address);
  17. if ($data) {
  18. return false;
  19. }
  20. return true;
  21. }
  22. }