update api
This commit is contained in:
@@ -61,14 +61,14 @@ class CustomerController extends Controller
|
||||
return response()->json($customer_all);
|
||||
}
|
||||
|
||||
public function showOneCustomerByICMobile(Request $request){
|
||||
public function showOneCustomerByICMobile($ic){
|
||||
|
||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||
$customer_all = [];
|
||||
foreach($cawangan_all as $index=>$cawangan){
|
||||
$customer = Customer::on($cawangan['mysql'])
|
||||
->where('kplama','=',$request->ic)
|
||||
->orWhere('kpbaru','=',$request->ic)
|
||||
->where('kplama','=',$ic)
|
||||
->orWhere('kpbaru','=',$ic)
|
||||
->first();
|
||||
if($customer != null){
|
||||
array_push($customer_all,$customer);
|
||||
@@ -118,30 +118,30 @@ class CustomerController extends Controller
|
||||
return response()->json($gadai_all);
|
||||
}
|
||||
|
||||
public function showOneCustomerGadaiMobile(Request $request){
|
||||
if($request->status == 'belum_tebus'){
|
||||
public function showOneCustomerGadaiMobile($ic,$status){
|
||||
if($status == 'belum_tebus'){
|
||||
$gadai_status = '';
|
||||
}elseif($request->status == 'sudah_tebus'){
|
||||
}elseif($status == 'sudah_tebus'){
|
||||
$gadai_status = 'T';
|
||||
}elseif($request->status == 'lelong'){
|
||||
}elseif($status == 'lelong'){
|
||||
$gadai_status = 'L';
|
||||
}
|
||||
|
||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||
$gadai_all = [];
|
||||
foreach($cawangan_all as $index=>$cawangan){
|
||||
if($request->status == 'belum_tebus' || $request->status == 'sudah_tebus'){
|
||||
if($status == 'belum_tebus' || $status == 'sudah_tebus'){
|
||||
$gadai = Gadai::on($cawangan['mysql'])
|
||||
->where([['sttebus','=',$gadai_status],['nokp','=',$request->ic]])
|
||||
->where([['sttebus','=',$gadai_status],['nokp','=',$ic]])
|
||||
->get();
|
||||
if(sizeof($gadai) != 0){
|
||||
foreach($gadai as $index => $gadai_detail){
|
||||
array_push($gadai_all,['norujukan'=>$gadai_detail['norujukan'],'hargajualan'=>$gadai_detail['hargajualan'],'bakihargajualan'=>$gadai_detail['bakihargajualan']]);
|
||||
}
|
||||
}
|
||||
}elseif($request->status == 'lelong'){
|
||||
}elseif($status == 'lelong'){
|
||||
$gadai = Gadai::on($cawangan['mysql'])
|
||||
->where([['sttebus','=',$gadai_status],['nokp','=',$request->ic]])
|
||||
->where([['sttebus','=',$gadai_status],['nokp','=',$ic]])
|
||||
->rightJoin('lelong', 'gadai.norujukan', '=', 'lelong.norujukan')
|
||||
->get();
|
||||
if(sizeof($gadai) != 0){
|
||||
@@ -155,12 +155,12 @@ class CustomerController extends Controller
|
||||
return response()->json($gadai_all);
|
||||
}
|
||||
|
||||
public function show6BlnGadai(Request $request){
|
||||
public function show6BlnGadai($ic){
|
||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||
$gadai_all=[];
|
||||
foreach($cawangan_all as $index=>$cawangan){
|
||||
$gadai = Gadai::on($cawangan['mysql'])
|
||||
->where([['sttebus','=',''],['nokp','=',$request->ic],['jbg','>=',6]])
|
||||
->where([['sttebus','=',''],['nokp','=',$ic],['jbg','>=',6]])
|
||||
->get();
|
||||
if(sizeof($gadai) != 0){
|
||||
foreach($gadai as $index => $gadai_detail){
|
||||
|
||||
+3
-3
@@ -191,9 +191,9 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
});
|
||||
|
||||
$router->group(['prefix'=>'mobile'], function () use ($router){
|
||||
$router->post('customers/details',['uses'=>'CustomerController@showOneCustomerByICMobile']);
|
||||
$router->post('customers/gadai',['uses'=>'CustomerController@showOneCustomerGadaiMobile']);
|
||||
$router->post('customers/gadai/amaran/lelong',['uses'=>'CustomerController@show6BlnGadai']);
|
||||
$router->get('customers/{ic}',['uses'=>'CustomerController@showOneCustomerByICMobile']);
|
||||
$router->get('customers/{ic}/gadai/{status}',['uses'=>'CustomerController@showOneCustomerGadaiMobile']);
|
||||
$router->get('customers/{ic}/gadai/amaran/lelong',['uses'=>'CustomerController@show6BlnGadai']);
|
||||
|
||||
$router->get('harga_emas',['uses'=>'HargaEmasController@showAllHargaEmasMobile']);
|
||||
});
|
||||
Reference in New Issue
Block a user