fix disabled after payment

This commit is contained in:
hafifierahman
2025-01-21 00:06:55 +08:00
parent aee216430c
commit 8df8551f83
+8 -4
View File
@@ -144,8 +144,8 @@ class PembiayaanService
{
$getRecentlyAttemptPayment = function () use ($norujukanList) {
return Http::pool(function (Pool $pool) use ($norujukanList) {
foreach ($norujukanList as $norujukan) {
$pool->get(config('api.url') . '/portal/searchsagonline/', ['norujukan' => $norujukan]);
foreach ($norujukanList as $list) {
$pool->get(($list['tag_syarikat'] == CompanyStatus::COM_PKB ? config('api.url') : config('api.url_koop')) . '/portal/searchsagonline/', ['norujukan' => $list['norujukan']]);
}
});
};
@@ -166,8 +166,11 @@ class PembiayaanService
}
private function checkPembiayaanPaymentDisabled($pembiayaan)
{
$norujukanList = array_map(fn($x) => $x->norujukan, $pembiayaan);
{
$norujukanList = array_map(fn($x) => [
'tag_syarikat' => $x->tag_syarikat,
'norujukan' => $x->norujukan,
], $pembiayaan);
$norujukanRecentlyAttemptPayment = $this->getNorujukanRecentlyAttemptPayment($norujukanList);
@@ -205,6 +208,7 @@ class PembiayaanService
$kodCawanganBranchesNotPermitPaymentUjrah = array_map(fn($x) => $x['kodcaw'], $branchesNotPermitPaymentUjrah);
$isNorujukanPaymentRecentlyAttempted = function ($x) use ($norujukanRecentlyAttemptPayment) {
$norujukanRecentlyAttemptPayment = array_column($norujukanRecentlyAttemptPayment, 'norujukan');
return in_array($x->norujukan, $norujukanRecentlyAttemptPayment);
};