This commit is contained in:
hafifie rahman
2020-10-27 12:15:52 +08:00
parent cf3555e593
commit d9feeb73f3
2 changed files with 19 additions and 4 deletions
+16 -2
View File
@@ -32,7 +32,21 @@ class GadaiController extends Controller
array_push($gadai_all,$gadai);
}
}
return response()->json($gadai_all);
}
public function showOneGadaibyRujukan($norujukan)
{
$cawangan_all = Cawangan::on('mysql7')->get();
$gadai_all = [];
foreach($cawangan_all as $index=>$cawangan){
$gadai = Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->get();
if(sizeof($gadai) != 0){
array_push($gadai_all,$gadai);
}
}
return response()->json($gadai_all);
}
@@ -56,4 +70,4 @@ class GadaiController extends Controller
Gadai::findOrFail($id)->delete();
return response('Deleted Successfully', 200);
}
}
}