add insert record utk scan barcode tebus
This commit is contained in:
@@ -479,7 +479,9 @@ class TebusController extends Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function tagterimaupdate($kodcaw,$norujukan){
|
public function tagterimaupdate($kodcaw,$norujukan,Request $request){
|
||||||
|
$current = Carbon::now();
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
$dahscan = Tebus::on($cawangan['mysql'])->where([['norujukan','=',$norujukan],['tagterima',1]])->first();
|
$dahscan = Tebus::on($cawangan['mysql'])->where([['norujukan','=',$norujukan],['tagterima',1]])->first();
|
||||||
|
|
||||||
@@ -493,6 +495,15 @@ class TebusController extends Controller
|
|||||||
'tagterima' => 1
|
'tagterima' => 1
|
||||||
));
|
));
|
||||||
|
|
||||||
|
$audit = new Audit();
|
||||||
|
$audit->users = $request->nama;
|
||||||
|
$audit->actions = "Khazanah Scan Barcode Tebus";
|
||||||
|
$audit->norujukan = $norujukan;
|
||||||
|
$audit->kodcaw = $kodcaw;
|
||||||
|
$audit->created_at = $current;
|
||||||
|
$audit->updated_at = $current;
|
||||||
|
$audit->save();
|
||||||
|
|
||||||
return response()->json('success');
|
return response()->json('success');
|
||||||
}else{
|
}else{
|
||||||
return response()->json('unavailable');
|
return response()->json('unavailable');
|
||||||
|
|||||||
Reference in New Issue
Block a user