This commit is contained in:
2021-03-26 19:22:11 +08:00
parent 0825725abe
commit f8e2ae5b40
2 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -294,8 +294,7 @@ class SqlBuilder extends Component
public function tableName(): string
{
if ($this->query->from instanceof \Closure) {
call_user_func($this->query->from, $activeQuery = new Sql());
$this->query->from = '(' . $activeQuery->getSql() . ')';
$this->query->from = '(' . $this->query->makeClosureFunction($this->query->from) . ')';
}
if ($this->query->from instanceof ActiveQuery) {
$this->query->from = '(' . SqlBuilder::builder($this->query->from)->get($this->query->from) . ')';