fix customer admin

This commit is contained in:
afiq
2021-08-09 12:10:19 +08:00
parent bb32bf8832
commit 3ae009b3c7
2 changed files with 18 additions and 0 deletions
@@ -63,6 +63,23 @@ class CustomerController extends Controller
return response()->json($customer);
}
public function showOneCustomerByICAdmin(Request $request){
// $cawangan_all = Cawangan::on('mysql7')->get();
// $customer_all = [];
// foreach($cawangan_all as $index=>$cawangan){
$customer = Customer::on('mysql7')
->where('kplama','=',$request->ic)
->orWhere('kpbaru','=',$request->ic)
->first();
// if($customer != null){
// array_push($customer_all,$customer);
// }
// }
return response()->json($customer);
}
public function showOneCustomerByICMobile($ic){
$cawangan_all = Cawangan::on('mysql7')->get();
+1
View File
@@ -37,6 +37,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
$router->get('customers/laporan/{kodcaw}/{tarikh}',['uses'=>'CustomerController@getLaporanCustomers']);
$router->get('customers/latest/{kodcaw}',['uses'=>'CustomerController@getLatestCustomer']);
$router->put('customers/information/update/admin', ['uses' => 'CustomerController@customerUpdateAdmin']);
$router->get('admin/customers/nokp/search',['uses'=>'CustomerController@showOneCustomerByICAdmin']);
//Gadai API
$router->get('gadai',['uses'=>'GadaiController@showAllGadais']);