mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Merge pull request #13363 from inietov/fixes/no_records_found_multipage_license_seats
Fixed #13298 "No records Found" when Switching between Single and Multi-Page Licenses
This commit is contained in:
commit
f6545be410
|
@ -42,6 +42,11 @@ class LicenseSeatsController extends Controller
|
||||||
|
|
||||||
// Make sure the offset and limit are actually integers and do not exceed system limits
|
// Make sure the offset and limit are actually integers and do not exceed system limits
|
||||||
$offset = ($request->input('offset') > $seats->count()) ? $seats->count() : abs($request->input('offset'));
|
$offset = ($request->input('offset') > $seats->count()) ? $seats->count() : abs($request->input('offset'));
|
||||||
|
|
||||||
|
if ($offset >= $total ){
|
||||||
|
$offset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$limit = app('api_limit_value');
|
$limit = app('api_limit_value');
|
||||||
|
|
||||||
$seats = $seats->skip($offset)->take($limit)->get();
|
$seats = $seats->skip($offset)->take($limit)->get();
|
||||||
|
|
Loading…
Reference in a new issue