From 67450366721ab275c1e5493b6f48ffc9b43d8a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sat, 13 Nov 2021 04:08:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Base/Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }