This commit is contained in:
2024-12-13 14:35:04 +08:00
parent 263f99c8c3
commit c444de4815
+1 -1
View File
@@ -401,7 +401,7 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
public function from(string|Closure $tableName): static
{
if ($tableName instanceof Closure) {
$this->from = $this->makeClosureFunction($tableName);
$this->from = '(' . $this->makeClosureFunction($tableName) . ')';
} else if (class_exists($tableName)) {
$this->from = (new $tableName)->getTable();
} else {