This commit is contained in:
2020-11-05 19:05:47 +08:00
parent f4487f5ca3
commit 14a764664d
+3 -2
View File
@@ -276,14 +276,15 @@ class Columns extends Component
private function structure($table) private function structure($table)
{ {
if (isset($this->columns[$table])) { if (isset($this->columns[$table])) {
return $this->columns[$table];
}
$sql = $this->db->getBuild()->getColumn($table); $sql = $this->db->getBuild()->getColumn($table);
$column = $this->db->createCommand($sql)->all(); $column = $this->db->createCommand($sql)->all();
if (empty($column)) { if (empty($column)) {
throw new Exception("The table " . $table . " not exists."); throw new Exception("The table " . $table . " not exists.");
} }
return $this->columns[$table] = $this->resolve($column, $table); return $this->columns[$table] = $this->resolve($column, $table);
}
return $this->columns[$table];
} }