This commit is contained in:
xl
2023-06-12 15:31:47 +08:00
parent 1cf6a7bf8b
commit fa094fd387
2 changed files with 269 additions and 269 deletions
+1 -1
View File
@@ -253,7 +253,7 @@ class Gii
}
foreach ($tables as $key => $val) {
if (empty($val)) continue;
$_tmp = Db::findAllBySql('SHOW FULL FIELDS FROM `' . $this->db->database . '`.' . $val, [], $this->db);
$_tmp = Db::connect($this->db)->query('SHOW FULL FIELDS FROM `' . $this->db->database . '`.' . $val, []);
if (empty($_tmp)) {
continue;
}
+2 -2
View File
@@ -296,7 +296,7 @@ class ' . $managerName . ' extends Model
$key = '\'maxLength\' => ' . $key;
}
$string[] = '
[[\'' . implode('\', \'', array_column($_val, 3)) . '\'], ' . ($_val[0][1] == 'enum' ? '\'enum\' => [' . $key .']' : $key) . ']';
[[\'' . implode('\', \'', array_column($_val, 3)) . '\'], ' . ($_val[0][1] == 'enum' ? '\'enum\' => [' . $key . ']' : $key) . ']';
}
return implode(',', $string);
}
@@ -392,7 +392,7 @@ class ' . $managerName . ' extends Model
return Gii::$createSqls[$table];
}
$text = Db::showCreateSql($table, $this->db)['Create Table'] ?? '';
$text = Db::connect($this->db)->one('SHOW CREATE TABLE `'.$this->db->database. '`.`' . $table.'`')['Create Table'] ?? '';
$_tmp = [];
foreach (explode(PHP_EOL, $text) as $val) {