This commit is contained in:
xl
2024-10-11 11:55:32 +08:00
parent 4fc9b42540
commit bf5d988ba4
+2 -1
View File
@@ -445,7 +445,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, \
if (!$this->hasPrimary()) {
return $this->refresh()->afterSave($this->_attributes, []);
}
$this->_attributes[$this->getPrimary()] = $lastId;
return $this->refresh()->afterSave($this->_attributes, [$this->getPrimary() => $lastId]);
@@ -658,6 +658,7 @@ abstract class Model extends Component implements ModelInterface, ArrayAccess, \
public function refresh(): static
{
$this->_oldAttributes = $this->_attributes;
$this->isNewExample = false;
return $this;
}