DONE: use annur api when feature enabled
This commit is contained in:
@@ -26,6 +26,7 @@ class CawanganController extends Controller
|
||||
|
||||
$data = $cawangan->toArray();
|
||||
$data['features'] = Feature::mapFor($code_cawangan);
|
||||
$data['api_arrahnbid'] = Feature::arrahnbidUrl($code_cawangan);
|
||||
|
||||
return response()->json($data);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ use App\Negeri;
|
||||
use App\Lelong;
|
||||
use App\Transaction;
|
||||
use App\Cawangan;
|
||||
use App\Feature;
|
||||
use App\Gadai;
|
||||
use App\TuntutBaki;
|
||||
use App\WTD;
|
||||
@@ -604,13 +605,7 @@ class LelongController extends Controller
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
||||
|
||||
if($cawangan['tagarrahnbid'] == 1){
|
||||
if(env('APP_ENV') != 'production'){
|
||||
$link = 'https://adminbid-kopkb.erahn.com.my/api/portalApi';
|
||||
}else{
|
||||
$link = 'https://adminbid-kopkb.erahn.com.my/api/portalApi';
|
||||
}
|
||||
|
||||
$lelong = Http::withOptions(['verify' => true])->get($link,[
|
||||
$lelong = Http::withOptions(['verify' => true])->get(Feature::arrahnbidUrl($request->kodcaw).'portalApi',[
|
||||
'norujukan' => $request->norujukan
|
||||
])->json();
|
||||
$lelong = ($lelong != null) ? $lelong['lelong'] : [];
|
||||
@@ -656,7 +651,7 @@ class LelongController extends Controller
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw', '=', $request->kodcaw)->first();
|
||||
|
||||
if ($cawangan['tagarrahnbid'] == 0){
|
||||
$lelong = Http::withOptions(['verify' => true])->get(config('app_parameter.api_arrahnbid').'portalApi',[
|
||||
$lelong = Http::withOptions(['verify' => true])->get(Feature::arrahnbidUrl($request->kodcaw).'portalApi',[
|
||||
'norujukan' => $request->norujukan
|
||||
])->json();
|
||||
$lelong = ($lelong != null) ? $lelong['lelong'] : [];
|
||||
@@ -729,7 +724,7 @@ class LelongController extends Controller
|
||||
|
||||
if($cawangan['tagarrahnbid'] == 1)
|
||||
{
|
||||
$lelong = Http::withOptions(['verify' => true])->get(config('app_parameter.api_arrahnbid').'portalApi',['norujukan' => $request->norujukan])->json();
|
||||
$lelong = Http::withOptions(['verify' => true])->get(Feature::arrahnbidUrl($request->kodcaw).'portalApi',['norujukan' => $request->norujukan])->json();
|
||||
$lelong = ($lelong != null) ? $lelong['lelong'] : [];
|
||||
}else{
|
||||
$lelong = Lelong::on($cawangan['mysql'])->where([['norujukan',$request->norujukan]])->first();
|
||||
|
||||
Reference in New Issue
Block a user