FundIdCheck.php 407 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Module\Fund\Validators;
  3. use App\Module\Fund\Enums\FUND_TYPE;
  4. use UCore\Validator;
  5. /**
  6. * 账户ID验证,有效true
  7. *
  8. */
  9. class FundIdCheck extends Validator
  10. {
  11. public function validate(mixed $value, array $data): bool
  12. {
  13. $ks = FUND_TYPE::toArray();
  14. if (in_array($value, array_values($ks))) {
  15. return true;
  16. }
  17. return false;
  18. }
  19. }