pelanggan

This commit is contained in:
MUHD HAFIFIE
2021-05-12 17:44:11 +08:00
parent c16c006cbd
commit 597e2be0f9
3 changed files with 35 additions and 5 deletions
@@ -397,6 +397,37 @@ class CustomerController extends Controller
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){
$cawangan_all = Cawangan::on('mysql7')->get();
$array_norujukan = [];
+3 -5
View File
@@ -925,11 +925,6 @@ class GadaiController extends Controller
$array_kawalanstok = [];
$kawalanstoklama = KawalanStokLama::on($cawangan['mysql'])
->get();
////////////
///GADAI////
///////////
@@ -1083,6 +1078,9 @@ class GadaiController extends Controller
if($kodcaw == 'KB2')
{
$kawalanstoklama = KawalanStokLama::on($cawangan['mysql'])
->get();
foreach($kawalanstoklama as $indexgad => $gadaikawalanstok)
{
//Gadai
+1
View File
@@ -29,6 +29,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
$router->delete('customers/{kodcaw}/{nokp}', ['uses' => 'CustomerController@delete']);
$router->put('customers/update/{nokp}', ['uses' => 'CustomerController@customerUpdate']);
$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/latest/{kodcaw}',['uses'=>'CustomerController@getLatestCustomer']);