From 93b6f1e2f1afac988d533d8b4cd5038b812a29ed Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Tue, 8 Sep 2020 19:36:24 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catch/system/controller/DataDictionary.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/catch/system/controller/DataDictionary.php b/catch/system/controller/DataDictionary.php index ca2b463..89450d3 100644 --- a/catch/system/controller/DataDictionary.php +++ b/catch/system/controller/DataDictionary.php @@ -42,7 +42,10 @@ class DataDictionary extends CatchController $tables = $tables->where('engine', $engine)->values(); } - return CatchResponse::paginate(Paginator::make(array_slice($tables->toArray(), ($request->get('page') ?? 1) - 1,$request->get('limit') ?? 10), $request->get('limit') ?? 10, $request->get('page') ?? 1, $tables->count(), false, [])); + $page = $request->get('page', 1); + $limit = $request->get('limit', 10); + + return CatchResponse::paginate(Paginator::make(array_slice($tables->toArray(), ($page - 1) * $limit, $limit), $limit, $page, $tables->count(), false, [])); } /**