pelanggan
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user