fix customer api
This commit is contained in:
@@ -44,12 +44,12 @@ class CustomersController extends Controller
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. Session::get('noic'))->json();
|
||||
if($customers_info){
|
||||
$customer_info = $customers_info[0];
|
||||
}else{
|
||||
$customer_info = $customers_info;
|
||||
}
|
||||
$customer_info = Http::get(config('api.url') . '/api/customers/'. Session::get('noic'))->json();
|
||||
// if($customers_info){
|
||||
// $customer_info = $customers_info[0];
|
||||
// }else{
|
||||
// $customer_info = $customers_info;
|
||||
// }
|
||||
|
||||
$bakilelong = Http::get(config('api.url') . '/api/bakilelong/cawangan/' . $auth_user['cawangan'] . '/' . Session::get('noic') . '/baki')->json();
|
||||
$rugilelong = Http::get(config('api.url') . '/api/bakilelong/cawangan/' . $auth_user['cawangan'] . '/' . Session::get('noic') . '/rugi')->json();
|
||||
@@ -68,13 +68,13 @@ class CustomersController extends Controller
|
||||
$auth_user = Auth::user();
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$bank = Http::get(config('api.url') . '/api/bank')->json();
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
$customer_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
|
||||
if($customers_info){
|
||||
$customer_info = $customers_info[0];
|
||||
}else{
|
||||
$customer_info = $customers_info;
|
||||
}
|
||||
// if($customers_info){
|
||||
// $customer_info = $customers_info[0];
|
||||
// }else{
|
||||
// $customer_info = $customers_info;
|
||||
// }
|
||||
$request->session()->forget('page_reload');
|
||||
$request->session()->forget('norujukan');
|
||||
|
||||
@@ -94,7 +94,7 @@ class CustomersController extends Controller
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $request->icno)->json();
|
||||
|
||||
if(sizeof($customers_info) > 0)
|
||||
return $customers_info[0];
|
||||
return $customers_info;
|
||||
else
|
||||
return "no-data";
|
||||
}
|
||||
@@ -242,7 +242,7 @@ class CustomersController extends Controller
|
||||
|
||||
$nokp = $request->noic_otp;
|
||||
$customer = Http::get(config('api.url'). '/api/customers/'.$nokp)->json();
|
||||
$recipient = '+6'.$customer[0]['telefon'];
|
||||
$recipient = '+6'.$customer['telefon'];
|
||||
//pembinaan token
|
||||
function token($length) {
|
||||
$characters = array(
|
||||
|
||||
Reference in New Issue
Block a user