pelanggan
This commit is contained in:
@@ -397,6 +397,37 @@ class CustomerController extends Controller
|
|||||||
return response()->json($customer_update, 200);
|
return response()->json($customer_update, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function customerUpdateKhazanah($nokp,Request $request){
|
||||||
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
|
foreach($cawangan_all as $index=>$cawangan){
|
||||||
|
$customer = Customer::on($cawangan['mysql'])
|
||||||
|
->where('kplama','=',$nokp)
|
||||||
|
->orWhere('kpbaru','=',$nokp)
|
||||||
|
->first();
|
||||||
|
if($customer != null){
|
||||||
|
$poskod = Poskod::on('mysql7')->where('poskod','=',$request->poskod)->first();
|
||||||
|
|
||||||
|
$customer_update = Customer::on($cawangan['mysql'])
|
||||||
|
->where('kplama','=',$nokp)
|
||||||
|
->orWhere('kpbaru','=',$nokp)
|
||||||
|
->update(array(
|
||||||
|
'telefon' => $request->telefon1,
|
||||||
|
'telefon2' => $request->telefon2,
|
||||||
|
'kodbank' => $request->kodbank,
|
||||||
|
'noakaun' => $request->noakaun,
|
||||||
|
'nota' => $request->nota,
|
||||||
|
'nama' => $request->nama,
|
||||||
|
'alamat1' => $request->alamat,
|
||||||
|
'poskod' => $request->poskod,
|
||||||
|
'koddaerah' => $poskod['koddaerah'],
|
||||||
|
'kodnegeri' => $poskod['kodnegeri']
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json($customer_update, 200);
|
||||||
|
}
|
||||||
|
|
||||||
public function listNorujukanMobile($nokp){
|
public function listNorujukanMobile($nokp){
|
||||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
$array_norujukan = [];
|
$array_norujukan = [];
|
||||||
|
|||||||
@@ -925,11 +925,6 @@ class GadaiController extends Controller
|
|||||||
|
|
||||||
$array_kawalanstok = [];
|
$array_kawalanstok = [];
|
||||||
|
|
||||||
|
|
||||||
$kawalanstoklama = KawalanStokLama::on($cawangan['mysql'])
|
|
||||||
->get();
|
|
||||||
|
|
||||||
|
|
||||||
////////////
|
////////////
|
||||||
///GADAI////
|
///GADAI////
|
||||||
///////////
|
///////////
|
||||||
@@ -1083,6 +1078,9 @@ class GadaiController extends Controller
|
|||||||
|
|
||||||
if($kodcaw == 'KB2')
|
if($kodcaw == 'KB2')
|
||||||
{
|
{
|
||||||
|
$kawalanstoklama = KawalanStokLama::on($cawangan['mysql'])
|
||||||
|
->get();
|
||||||
|
|
||||||
foreach($kawalanstoklama as $indexgad => $gadaikawalanstok)
|
foreach($kawalanstoklama as $indexgad => $gadaikawalanstok)
|
||||||
{
|
{
|
||||||
//Gadai
|
//Gadai
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
|||||||
$router->delete('customers/{kodcaw}/{nokp}', ['uses' => 'CustomerController@delete']);
|
$router->delete('customers/{kodcaw}/{nokp}', ['uses' => 'CustomerController@delete']);
|
||||||
$router->put('customers/update/{nokp}', ['uses' => 'CustomerController@customerUpdate']);
|
$router->put('customers/update/{nokp}', ['uses' => 'CustomerController@customerUpdate']);
|
||||||
$router->put('customers/update/kaunter/{nokp}', ['uses' => 'CustomerController@customerUpdateKaunter']);
|
$router->put('customers/update/kaunter/{nokp}', ['uses' => 'CustomerController@customerUpdateKaunter']);
|
||||||
|
$router->put('customers/update/khazanah/{nokp}', ['uses' => 'CustomerController@customerUpdateKhazanah']);
|
||||||
$router->get('customers/laporan/{kodcaw}/{tarikh}',['uses'=>'CustomerController@getLaporanCustomers']);
|
$router->get('customers/laporan/{kodcaw}/{tarikh}',['uses'=>'CustomerController@getLaporanCustomers']);
|
||||||
$router->get('customers/latest/{kodcaw}',['uses'=>'CustomerController@getLatestCustomer']);
|
$router->get('customers/latest/{kodcaw}',['uses'=>'CustomerController@getLatestCustomer']);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user