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 = [];