|
|
@@ -15,8 +15,10 @@ class MacroPageMiddleware
|
|
|
$request->macro('pageAndLimit', function (): array {
|
|
|
$page = input('page/d', 1);
|
|
|
$limit = input('limit/d', 10);
|
|
|
+ $perPage = input('per_page/d', 10);
|
|
|
+ $limit = $perPage > $limit ? $perPage : $limit;
|
|
|
throw_if($page < 1, Exception::class, '页码不能小于1');
|
|
|
- throw_if($limit < 1 || $limit > 100, Exception::class, '每页数量必须在1-100之间');
|
|
|
+ throw_if($limit < 1 || $limit > 200, Exception::class, '每页数量必须在1-200之间');
|
|
|
return ['page' => $page, 'list_rows' => $limit];
|
|
|
});
|
|
|
return $next($request);
|