This commit is contained in:
2023-12-13 15:36:52 +08:00
parent f4ac618a1d
commit a9d315a6c0
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -217,7 +217,7 @@ class Gii
private function showAll(): array
{
$res = [];
$_tables = Db::connect($this->db)->query('SHOW TABLES FROM `' . $this->db->database . '`');
$_tables = Db::connect($this->db)->fetchAll('SHOW TABLES FROM `' . $this->db->database . '`');
if (empty($_tables)) {
return $res;
}
@@ -234,7 +234,7 @@ class Gii
*/
private function getIndex($table): bool|int|null
{
$data = Db::connect($this->db)->query('SHOW INDEX FROM `' . $this->db->database . '`.`' . $table . '`', []);
$data = Db::connect($this->db)->fetchAll('SHOW INDEX FROM `' . $this->db->database . '`.`' . $table . '`', []);
return empty($data) ? NULL : $data[0];
}
@@ -253,7 +253,7 @@ class Gii
}
foreach ($tables as $key => $val) {
if (empty($val)) continue;
$_tmp = Db::connect($this->db)->query('SHOW FULL FIELDS FROM `' . $this->db->database . '`.' . $val, []);
$_tmp = Db::connect($this->db)->fetchAll('SHOW FULL FIELDS FROM `' . $this->db->database . '`.' . $val, []);
if (empty($_tmp)) {
continue;
}
+1 -1
View File
@@ -391,7 +391,7 @@ class ' . $managerName . ' extends Model
return Gii::$createSqls[$table];
}
$text = Db::connect($this->db)->one('SHOW CREATE TABLE `'.$this->db->database. '`.`' . $table.'`')['Create Table'] ?? '';
$text = Db::connect($this->db)->fetch('SHOW CREATE TABLE `'.$this->db->database. '`.`' . $table.'`')['Create Table'] ?? '';
$_tmp = [];
foreach (explode(PHP_EOL, $text) as $val) {