untuk lelong masuk tag_syarikat
This commit is contained in:
@@ -53,6 +53,7 @@ class InformationController extends Controller
|
||||
if(isset($customer_pkb['lelong'])){
|
||||
if(sizeof($customer_pkb['lelong']) > 0){
|
||||
foreach($customer_pkb['lelong'] as $index=>$lelong){
|
||||
$customer_pkb['lelong'][$index]['tag_syarikat'] = CompanyStatus::COM_KOOPPKB;
|
||||
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api-lelong.url') . '/api/portalApi',['norujukan' => $lelong['norujukan']])->json();
|
||||
|
||||
if($array_lelong === null){
|
||||
@@ -71,6 +72,7 @@ class InformationController extends Controller
|
||||
if(isset($customer_koop['lelong'])){
|
||||
if(sizeof($customer_koop['lelong']) > 0){
|
||||
foreach($customer_koop['lelong'] as $index=>$lelong){
|
||||
$customer_koop['lelong'][$index]['tag_syarikat'] = CompanyStatus::COM_KOOPPKB;
|
||||
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api-lelong.url_koop') . '/api/portalApi',['norujukan' => $lelong['norujukan']])->json();
|
||||
|
||||
if($array_lelong === null){
|
||||
@@ -94,14 +96,16 @@ class InformationController extends Controller
|
||||
{
|
||||
$auth_user = Auth::User();
|
||||
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
$customer_pkb = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
$customer_koop = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url_koop') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
|
||||
$melebihi6bulan = [];
|
||||
|
||||
if(isset($CustomerInfo['gadai']))
|
||||
if(isset($customer_pkb['gadai']))
|
||||
{
|
||||
foreach($CustomerInfo['gadai'] as $index=>$gadai)
|
||||
foreach($customer_pkb['gadai'] as $index=>$gadai)
|
||||
{
|
||||
$gadai['tag_syarikat'] = CompanyStatus::COM_PKB;
|
||||
if($gadai['tempoh'] >= 6)
|
||||
{
|
||||
array_push($melebihi6bulan,$gadai);
|
||||
@@ -109,6 +113,21 @@ class InformationController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($customer_koop['gadai']))
|
||||
{
|
||||
foreach($customer_koop['gadai'] as $index=>$gadai)
|
||||
{
|
||||
$gadai['tag_syarikat'] = CompanyStatus::COM_KOOPPKB;
|
||||
|
||||
if($gadai['tempoh'] >= 6)
|
||||
{
|
||||
array_push($melebihi6bulan,$gadai);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return response()->json($melebihi6bulan,200);
|
||||
// return view('includes.information.melebihi6bulan',compact('melebihi6bulan'));
|
||||
}
|
||||
@@ -117,12 +136,13 @@ class InformationController extends Controller
|
||||
{
|
||||
$auth_user = Auth::User();
|
||||
|
||||
$CustomerInfo = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
$customer_pkb = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
$customer_koop = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url_koop') .'/portal/customer/info',['ic' => $auth_user['icno']])->json();
|
||||
|
||||
$lelong = [];
|
||||
if(isset($CustomerInfo['lelong'])){
|
||||
if(sizeof($CustomerInfo['lelong']) > 0){
|
||||
foreach($CustomerInfo['lelong'] as $index=>$lel){
|
||||
if(isset($customer_pkb['lelong'])){
|
||||
if(sizeof($customer_pkb['lelong']) > 0){
|
||||
foreach($customer_pkb['lelong'] as $index=>$lel){
|
||||
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api-lelong.url') . '/api/portalApi',['norujukan' => $lel['norujukan']])->json();
|
||||
|
||||
if($array_lelong === null){
|
||||
@@ -130,11 +150,29 @@ class InformationController extends Controller
|
||||
}
|
||||
|
||||
if($array_lelong['lelong'] !== null){
|
||||
$CustomerInfo['lelong'][$index] = collect($lel)->merge($array_lelong['lelong'])->toArray();
|
||||
$customer_pkb['lelong'][$index] = collect($lel)->merge($array_lelong['lelong'])->toArray();
|
||||
}
|
||||
}
|
||||
$lelong = collect($lelong)->merge($CustomerInfo['lelong']);
|
||||
$lelong = $lelong->toArray();
|
||||
$lelong = collect($lelong)->merge($customer_pkb['lelong']);
|
||||
$lelong = $lelong->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($customer_koop['lelong'])){
|
||||
if(sizeof($customer_koop['lelong']) > 0){
|
||||
foreach($customer_koop['lelong'] as $index=>$lel){
|
||||
$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api-lelong.url') . '/api/portalApi',['norujukan' => $lel['norujukan']])->json();
|
||||
|
||||
if($array_lelong === null){
|
||||
continue;
|
||||
}
|
||||
|
||||
if($array_lelong['lelong'] !== null){
|
||||
$customer_koop['lelong'][$index] = collect($lel)->merge($array_lelong['lelong'])->toArray();
|
||||
}
|
||||
}
|
||||
$lelong = collect($lelong)->merge($customer_koop['lelong']);
|
||||
$lelong = $lelong->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user