Merge pull request #16 from Chance-fyi/main

select COLUMNS order by ORDINAL_POSITION
This commit is contained in:
walkor 2023-02-22 12:01:36 +08:00 committed by GitHub
commit d8e5dcff50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -370,7 +370,7 @@ class Util
{ {
Util::checkTableName($table); Util::checkTableName($table);
$database = config('database.connections')['plugin.admin.mysql']['database']; $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 = []; $forms = [];
$columns = []; $columns = [];
foreach ($schema_raw as $item) { foreach ($schema_raw as $item) {