fix issues lelong arrahnbid
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\LelongBid;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
@@ -37,6 +38,16 @@ class InformationController extends Controller
|
||||
$pembiayaansemasa = $CustomerInfo['gadai'];
|
||||
}
|
||||
|
||||
if(isset($CustomerInfo['lelong'])){
|
||||
if(sizeof($CustomerInfo['lelong']) > 0){
|
||||
foreach($CustomerInfo['lelong'] as $index=>$lelong){
|
||||
$array_lelong = LelongBid::select('fasa','t_lelong')->where([['norujukan',$lelong['norujukan']],['hargajual','>',0]])->first()->toArray();
|
||||
$CustomerInfo['lelong'][$index] = collect($lelong)->merge($array_lelong)->toArray();
|
||||
}
|
||||
$pembiayaansemasa = collect($pembiayaansemasa)->merge($CustomerInfo['lelong']);
|
||||
}
|
||||
}
|
||||
$pembiayaansemasa = $pembiayaansemasa->toArray();
|
||||
return response()->json($pembiayaansemasa,200);
|
||||
// return view('includes.information.pembiayaanaktif',compact('pembiayaansemasa'));
|
||||
}
|
||||
@@ -71,9 +82,15 @@ class InformationController extends Controller
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
|
||||
$lelong = [];
|
||||
if(isset($CustomerInfo['lelong']))
|
||||
{
|
||||
$lelong += $CustomerInfo['lelong'];
|
||||
|
||||
if(isset($CustomerInfo['lelong'])){
|
||||
if(sizeof($CustomerInfo['lelong']) > 0){
|
||||
foreach($CustomerInfo['lelong'] as $index=>$lel){
|
||||
$array_lelong = LelongBid::select('fasa','t_lelong')->where([['norujukan',$lel['norujukan']],['hargajual','>',0]])->first()->toArray();
|
||||
$CustomerInfo['lelong'][$index] = collect($lel)->merge($array_lelong)->toArray();
|
||||
}
|
||||
$lelong = collect($lelong)->merge($CustomerInfo['lelong']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,3 +105,4 @@ class InformationController extends Controller
|
||||
return view('auth.termasyarat', compact('termasyarat'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user