Update and Bugs Fix

This commit is contained in:
Izuddin
2022-09-15 21:47:46 +07:00
parent 21d9ce5975
commit 187f80eb2a
13 changed files with 85 additions and 86 deletions
@@ -192,13 +192,15 @@ class ItemSearchController extends Controller
{
$sk = [];
$select = DB::raw("ID, NAME");
$grup = $request->grup;
if($request->has('q')){
$search = $request->q;
$sk = MstJenisBelanja::select($select)
->where('GRUP',$grup)
->where('NAME', 'LIKE', "%$search%")
->get();
}else{
$sk = MstJenisBelanja::select($select)->get();
$sk = MstJenisBelanja::select($select)->where('GRUP',$grup)->get();
}
return response()->json($sk);
}