From c30c830169f3364401d9fe28b15e12cc62576b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 17 Aug 2023 17:32:36 +0800 Subject: [PATCH] qqq --- Base/Model.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Base/Model.php b/Base/Model.php index ba04a82..14c6ed2 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -223,10 +223,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T */ public function getPrimaryValue(): ?int { - if ($this->hasPrimary()) { - return $this->getAttribute($this->getPrimary()); - } - return null; + return $this->_oldAttributes[$this->getPrimary()] ?? null; } /**