From dc4855f5c1f7c76a8eb71536f0cec8b0f4720bec Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Sat, 12 Sep 2020 11:11:59 +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=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- catch/system/controller/DataDictionary.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/catch/system/controller/DataDictionary.php b/catch/system/controller/DataDictionary.php index 89450d3..5f690b2 100644 --- a/catch/system/controller/DataDictionary.php +++ b/catch/system/controller/DataDictionary.php @@ -7,7 +7,6 @@ use catcher\CatchResponse; use catcher\exceptions\FailedException; use catcher\library\BackUpDatabase; use think\Collection; -use think\facade\Console; use think\facade\Db; use think\Paginator; @@ -24,7 +23,7 @@ class DataDictionary extends CatchController $tables = Db::query('show table status'); // 重组数据 - foreach ($tables as $key => &$table) { + foreach ($tables as &$table) { $table = array_change_key_case($table); $table['index_length'] = $table['index_length'] > 1024 ? intval($table['index_length']/1024) .'MB' : $table['index_length'].'KB'; $table['data_length'] = $table['data_length'] > 1024 ? intval($table['data_length']/1024) .'MB' : $table['data_length'].'KB'; @@ -41,8 +40,7 @@ class DataDictionary extends CatchController if ($engine = $request->get('engine', null)) { $tables = $tables->where('engine', $engine)->values(); } - - $page = $request->get('page', 1); + $page = $request->get('page', 1) ? : 1; $limit = $request->get('limit', 10); return CatchResponse::paginate(Paginator::make(array_slice($tables->toArray(), ($page - 1) * $limit, $limit), $limit, $page, $tables->count(), false, []));