feat: select COLUMNS order by ORDINAL_POSITION

This commit is contained in:
Chance 2023-02-22 11:29:24 +08:00
parent da5cea5321
commit 6e08b61cf5
No known key found for this signature in database
GPG Key ID: 3FA81A4CBF3B40B2

View File

@ -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) {