From 6e08b61cf5ff556bce23514f43f8ab4b77792a9e Mon Sep 17 00:00:00 2001 From: Chance <885046048@qq.com> Date: Wed, 22 Feb 2023 11:29:24 +0800 Subject: [PATCH] feat: select COLUMNS order by ORDINAL_POSITION --- src/plugin/admin/app/common/Util.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin/admin/app/common/Util.php b/src/plugin/admin/app/common/Util.php index 933bb84..848b0ff 100644 --- a/src/plugin/admin/app/common/Util.php +++ b/src/plugin/admin/app/common/Util.php @@ -370,7 +370,7 @@ class Util { Util::checkTableName($table); $database = config('database.connections')['plugin.admin.mysql']['database']; - $schema_raw = $section !== 'table' ? Util::db()->select("select * from information_schema.COLUMNS where TABLE_SCHEMA = '$database' and table_name = '$table'") : []; + $schema_raw = $section !== 'table' ? Util::db()->select("select * from information_schema.COLUMNS where TABLE_SCHEMA = '$database' and table_name = '$table' order by ORDINAL_POSITION") : []; $forms = []; $columns = []; foreach ($schema_raw as $item) {