From bbd4d7b353018802250d87df87fd59fdfb309b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 17 Aug 2023 17:30:53 +0800 Subject: [PATCH] qqq --- Base/Model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Base/Model.php b/Base/Model.php index 1e6e007..ba04a82 100644 --- a/Base/Model.php +++ b/Base/Model.php @@ -513,8 +513,8 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, T private function diff(): array { $changes = \array_diff_assoc($this->_attributes, $this->_oldAttributes); - if ($this->hasPrimaryValue()) { - $condition = [$this->getPrimary() => $this->getPrimaryValue()]; + if ($this->hasPrimary()) { + $condition = [$this->getPrimary() => $this->_oldAttributes[$this->getPrimary()]]; } else { $condition = \array_intersect_assoc($this->_oldAttributes, $this->_attributes); }