added total of pinjaman and count
This commit is contained in:
@@ -62,12 +62,26 @@ class HomeController extends Controller
|
||||
$pembiayaan = $this->pembiayaanService->getPembiayaan($request->filter);
|
||||
|
||||
$authUser = Auth::user();
|
||||
$customerInfo = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
$customer_pkb = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url') . '/portal/customer/info', ['ic' => $authUser['icno']])
|
||||
->json();
|
||||
|
||||
['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo;
|
||||
$customer_koop = Http::withOptions(['verify' => config('app.api_verify')])
|
||||
->get(config('api.url_koop') . '/portal/customer/info', ['ic' => $authUser['icno']])
|
||||
->json();
|
||||
|
||||
// ['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo;
|
||||
|
||||
$customer_gadai = array_merge(
|
||||
$customer_pkb['gadai'] ?? [],
|
||||
$customer_koop['gadai'] ?? []
|
||||
);
|
||||
|
||||
$customer_lelong = array_merge(
|
||||
$customer_pkb['lelong'] ?? [],
|
||||
$customer_koop['lelong'] ?? []
|
||||
);
|
||||
|
||||
// only get lelong that is harga jualan that is not null or 0
|
||||
$customer_lelong = array_filter($customer_lelong, fn($x) => $x['hargajualan'] != null && $x['hargajualan'] != 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user