diff --git a/src/Base/Model.php b/src/Base/Model.php index 386faaa..bc67f3f 100644 --- a/src/Base/Model.php +++ b/src/Base/Model.php @@ -822,8 +822,8 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T throw new Exception('You need add static method `tableName` and return table name.'); } $table = trim($this->table, '{{%}}'); - if (!empty($tablePrefix) && !str_starts_with($this->table, $tablePrefix)) { - $table = $tablePrefix . $this->table; + if (!empty($tablePrefix) && !str_starts_with($table, $tablePrefix)) { + $table = $tablePrefix . $table; } return '`' . $connection->database . '`.' . $table; }