From cbcad9e7c308968ff71988bca91e2a64fd63314b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 1 Mar 2022 17:37:45 +0800 Subject: [PATCH] modify plugin name --- Base/Model.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Base/Model.php b/Base/Model.php index 29770c8..6dec82d 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -544,8 +544,9 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T $dbConnection = $this->getConnection()->createCommand($sql, $param); $lastId = $dbConnection->save(); - - $lastId = $this->setPrimary((int)$lastId, $param); + if ($this->isAutoIncrement()) { + $lastId = $this->setPrimary((int)$lastId, $param); + } $this->setIsNowExample(false); @@ -713,10 +714,6 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T $uassoc = array_intersect_assoc($this->_attributes, $this->_oldAttributes); - if (!$this->getIsNowExample()) { - var_dump($assoc, $uassoc); - } - return [$assoc, $uassoc, array_keys($assoc)]; }