Fixed weird order number thing

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-06-22 21:16:24 +01:00
parent 5d4e704fac
commit 78d8e32a22

View file

@ -137,9 +137,6 @@ class AssetsController extends Controller
}
$request->filled('order_number') ? $assets = $assets->where('assets.order_number', '=', e($request->get('order_number'))) : '';
// Make sure the offset and limit are actually integers and do not exceed system limits
$offset = ($request->input('offset') > $assets->count()) ? $assets->count() : abs($request->input('offset'));
$limit = app('api_limit_value');
@ -303,6 +300,10 @@ class AssetsController extends Controller
$assets->where('assets.byod', '=', $request->input('byod'));
}
if ($request->filled('order_number')) {
$assets->where('assets.order_number', '=', $request->get('order_number'));
}
// This is kinda gross, but we need to do this because the Bootstrap Tables
// API passes custom field ordering as custom_fields.fieldname, and we have to strip
// that out to let the default sorter below order them correctly on the assets table.