This commit is contained in:
as2252258@163.com
2021-03-04 23:45:51 +08:00
parent 5676b0d7fd
commit 2936a75512
+2 -2
View File
@@ -827,7 +827,6 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
public function refresh(): static public function refresh(): static
{ {
$this->_oldAttributes = $this->_attributes; $this->_oldAttributes = $this->_attributes;
$this->setIsCreate(false);
return $this; return $this;
} }
@@ -1033,7 +1032,8 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
return new $className(); return new $className();
}); });
$model->_attributes = $data; $model->_attributes = $data;
$model->refresh(); $model->setIsCreate(false);
$model->refresh();
return $model; return $model;
} }