BusinessId.php 524 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Module\Transfer\Validator;
  3. use App\Module\Transfer\Model\TransferOrder;
  4. use Dcore\Validator;
  5. /**
  6. * 业务系统,业务ID
  7. *
  8. */
  9. class BusinessId extends Validator
  10. {
  11. public function validate(mixed $value, array $data): bool
  12. {
  13. $out_field = $this->args[0]??"";
  14. $out_id=$data[$out_field];
  15. $old = TransferOrder::query()->where('out_id', $out_id)->where('out_order_id',$value)->first();
  16. if($old){
  17. return false;
  18. }
  19. return true;
  20. }
  21. }