fix:分页方法修改

This commit is contained in:
xjh 2023-06-29 21:07:00 +08:00
parent e48a8d4e0f
commit 9e23d02980

View File

@ -130,9 +130,14 @@ abstract class BaseController
*/
protected static function pageWrapper($query)
{
return (clone $query)->page(
(int) Request::param('page', 1),
(int) Request::param('limit', 10)
);
$query_copy = (clone $query);
if (Request::param('all') === true) {
return $query_copy;
} else {
return $query_copy->page(
(int) Request::param('page', 1),
(int) Request::param('limit', 10)
);
}
}
}