edit buffer same as home

This commit is contained in:
hafifierahman
2025-01-13 00:30:23 +08:00
parent 1073f5f1f9
commit 8d6495e47d
+15 -2
View File
@@ -30,11 +30,24 @@ class HomeController extends Controller
{
$homeUrl = route('home');
$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);