fix scan
This commit is contained in:
@@ -529,11 +529,17 @@ class GadaiController extends Controller
|
|||||||
public function barcodeScan($kodcaw,$norujukan){
|
public function barcodeScan($kodcaw,$norujukan){
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
|
||||||
$gadai = Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(array(
|
$dahscan = Gadai::on($cawangan['mysql'])->where([['norujukan','=',$norujukan],['semakbarcode','Lulus']])->first();
|
||||||
'semakbarcode'=>'Lulus'
|
|
||||||
));
|
|
||||||
|
|
||||||
return response()->json($gadai,200);
|
if($dahscan){
|
||||||
|
return response()->json('scanned');
|
||||||
|
}else{
|
||||||
|
$gadai = Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update([
|
||||||
|
'semakbarcode'=>'Lulus'
|
||||||
|
]);
|
||||||
|
|
||||||
|
return response()->json('success');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkSerahGadaian(Request $request){
|
public function checkSerahGadaian(Request $request){
|
||||||
|
|||||||
@@ -580,10 +580,17 @@ class TebusController extends Controller
|
|||||||
|
|
||||||
public function tagterimaupdate($kodcaw,$norujukan){
|
public function tagterimaupdate($kodcaw,$norujukan){
|
||||||
$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();
|
||||||
|
|
||||||
$update_inoutmar = Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(array(
|
if($dahscan){
|
||||||
'tagterima' => 1
|
return response()->json('scanned');
|
||||||
));
|
}else{
|
||||||
|
$update_inoutmar = Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(array(
|
||||||
|
'tagterima' => 1
|
||||||
|
));
|
||||||
|
|
||||||
|
return response()->json('success');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkSerahTebus(Request $request){
|
public function checkSerahTebus(Request $request){
|
||||||
|
|||||||
Reference in New Issue
Block a user