From 592a42fcc5ad8282ff784db57aa82273efa1cd86 Mon Sep 17 00:00:00 2001 From: Karson Date: Thu, 16 May 2024 10:58:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=8E=E5=8F=B0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/controller/Backend.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/common/controller/Backend.php b/application/common/controller/Backend.php index e7924a0a..3963be41 100644 --- a/application/common/controller/Backend.php +++ b/application/common/controller/Backend.php @@ -268,13 +268,13 @@ class Backend extends Controller $op = $this->request->get("op", '', 'trim'); $sort = $this->request->get("sort", !empty($this->model) && $this->model->getPk() ? $this->model->getPk() : 'id'); $order = $this->request->get("order", "DESC"); - $offset = $this->request->get("offset/d", 0); - $limit = $this->request->get("limit/d", 0); + $offset = max(0, $this->request->get("offset/d", 0)); + $limit = max(0, $this->request->get("limit/d", 0)); $limit = $limit ?: 999999; //新增自动计算页码 $page = $limit ? intval($offset / $limit) + 1 : 1; if ($this->request->has("page")) { - $page = $this->request->get("page/d", 1); + $page = max(0, $this->request->get("page/d", 1)); } $this->request->get([config('paginate.var_page') => $page]); $filter = (array)json_decode($filter, true);