This commit is contained in:
weiz 2024-03-29 09:21:31 +08:00
parent dbd877f019
commit 79e8a5df01
2 changed files with 6 additions and 2 deletions

View File

@ -170,8 +170,10 @@
return in_array(1, $reimbursement_type); return in_array(1, $reimbursement_type);
} }
public function checkLoanApply($value): bool|string public function checkLoanApply($value, $rule, $data): bool|string
{ {
$reimbursement_type = explode(',', $data['reimbursement_type']);
if (!in_array(1, $reimbursement_type)) return true;
$loan_apply_data = ProjectLoanApply::where('id', $value)->findOrEmpty(); $loan_apply_data = ProjectLoanApply::where('id', $value)->findOrEmpty();
if ($loan_apply_data->isEmpty()) { if ($loan_apply_data->isEmpty()) {
return '借款单信息不存在'; return '借款单信息不存在';

View File

@ -170,8 +170,10 @@
return in_array(1, $reimbursement_type); return in_array(1, $reimbursement_type);
} }
public function checkLoanApply($value): bool|string public function checkLoanApply($value, $rule, $data): bool|string
{ {
$reimbursement_type = explode(',', $data['reimbursement_type']);
if (!in_array(1, $reimbursement_type)) return true;
$loan_apply_data = ProjectLoanApply::where('id', $value)->findOrEmpty(); $loan_apply_data = ProjectLoanApply::where('id', $value)->findOrEmpty();
if ($loan_apply_data->isEmpty()) { if ($loan_apply_data->isEmpty()) {
return '借款单信息不存在'; return '借款单信息不存在';