From 7b5c38dc4bd95956f6ab3de2d71e53b262f94e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 12 Apr 2021 16:16:36 +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 --- Gii/GiiModel.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gii/GiiModel.php b/Gii/GiiModel.php index e7943784..f781506b 100644 --- a/Gii/GiiModel.php +++ b/Gii/GiiModel.php @@ -218,7 +218,9 @@ use Database\ActiveRecord; $prefixed = $this->db->tablePrefix; if (!empty($prefixed)) { $field = str_replace($prefixed, '', $field); - $field = '{{%' . $field . '}}'; + if (str_starts_with($field, $prefixed)) { + $field = '{{%' . $field . '}}'; + } } return '