From 92f97abb768a7b971d34f0b0c672d50031026f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 19 Jan 2021 19:57:46 +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 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Gii/GiiModel.php b/Gii/GiiModel.php index 1464f10c..f225b3fb 100644 --- a/Gii/GiiModel.php +++ b/Gii/GiiModel.php @@ -126,16 +126,19 @@ class ' . $managerName . ' extends ActiveRecord $html .= ' ' . $debug . ' static $' . $key . ' = ' . $val . ';' . "\n"; } else { + if ($val == 'primary') { + continue; + } $html .= ' ' . $debug . ' $' . $key . ' = ' . $val . ';' . "\n"; } } - } else { - $primary = $this->createPrimary($this->fields); - if (!empty($primary)) { - $html .= $primary . "\n"; - } + } + + $primary = $this->createPrimary($this->fields); + if (!empty($primary)) { + $html .= $primary . "\n"; } $html .= $this->createTableName($this->tableName) . "\n";