@@ -34,10 +34,17 @@ final class PaymentRequestService
...
@@ -34,10 +34,17 @@ final class PaymentRequestService
return['success'=>false,'error'=>'المبلغ يجب أن يكون أكبر من صفر'];
return['success'=>false,'error'=>'المبلغ يجب أن يكون أكبر من صفر'];
}
}
$existing=$db->selectOne(
if($entityType!==null&&$entityId!==null){
"SELECT id FROM payment_requests WHERE member_id = ? AND payment_type = ? AND status IN ('pending','processing') AND is_voided = 0 LIMIT 1",
$existing=$db->selectOne(
[$memberId,$paymentType]
"SELECT id FROM payment_requests WHERE member_id = ? AND payment_type = ? AND related_entity_type = ? AND related_entity_id = ? AND status IN ('pending','processing') AND is_voided = 0 LIMIT 1",