mirror of
https://github.com/snipe/snipe-it.git
synced 2026-05-06 14:45:40 +00:00
Moved search scope lower to fix weird (possible Laravel) bug w/prepared statements
This commit is contained in:
@ -36,14 +36,15 @@ class AssetModelsController extends Controller
|
||||
->with('category','depreciation', 'manufacturer','fieldset')
|
||||
->withCount('assets');
|
||||
|
||||
if ($request->has('search')) {
|
||||
$assetmodels->TextSearch($request->input('search'));
|
||||
}
|
||||
|
||||
|
||||
if ($request->has('status')) {
|
||||
$assetmodels->onlyTrashed();
|
||||
}
|
||||
|
||||
if ($request->has('search')) {
|
||||
$assetmodels->TextSearch($request->input('search'));
|
||||
}
|
||||
|
||||
$offset = $request->input('offset', 0);
|
||||
$limit = $request->input('limit', 50);
|
||||
@ -60,6 +61,7 @@ class AssetModelsController extends Controller
|
||||
}
|
||||
|
||||
|
||||
|
||||
$total = $assetmodels->count();
|
||||
$assetmodels = $assetmodels->skip($offset)->take($limit)->get();
|
||||
return (new AssetModelsTransformer)->transformAssetModels($assetmodels, $total);
|
||||
|
||||
Reference in New Issue
Block a user