customer
This commit is contained in:
@@ -210,7 +210,6 @@ class CustomerController extends Controller
|
||||
}
|
||||
|
||||
public function createCustomer($kodcaw,Request $request){
|
||||
// dd($request);
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
@@ -239,6 +238,9 @@ class CustomerController extends Controller
|
||||
'aktif' => 'A',
|
||||
'telefon2' => $request->telefon2,
|
||||
'nosiri'=>$request->nosiri,
|
||||
'nota'=>$request->nota,
|
||||
'kodkerja'=>$request->kodkerja,
|
||||
'tujuangadai'=>$request->tujuangadai
|
||||
]);
|
||||
|
||||
return response()->json($customer, 201);
|
||||
@@ -271,6 +273,31 @@ class CustomerController extends Controller
|
||||
return response()->json($customer_update, 200);
|
||||
}
|
||||
|
||||
public function customerUpdateKaunter($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
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
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