Math is hard

This commit is contained in:
snipe
2019-09-03 14:29:58 -07:00
parent 4159a0effa
commit c256536d21
16 changed files with 19 additions and 16 deletions
@@ -42,7 +42,7 @@ class ManufacturersController extends Controller
$offset = (($manufacturers) && (request('offset') > $manufacturers->count())) ? 0 : request('offset', 0);
// Check to make sure the limit is not higher than the max allowed
(config('app.max_results') < $request->input('limit')) ? $limit = $request->input('limit') : $limit = config('app.max_results');
(config('app.max_results') >= $request->input('limit')) ? $limit = $request->input('limit') : $limit = config('app.max_results');
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';