This commit is contained in:
2021-03-16 10:47:36 +08:00
parent 3b8639ad21
commit f3bcb51667
+10 -7
View File
@@ -425,13 +425,16 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
if (empty($param)) { if (empty($param)) {
return $this; return $this;
} }
foreach ($param as $key => $val) {
if ($this->has($key)) { $this->_attributes = array_merge($this->_attributes, $param);
$this->setAttribute($key, $val); //
} else { // foreach ($param as $key => $val) {
$this->$key = $val; // if ($this->has($key)) {
} // $this->setAttribute($key, $val);
} // } else {
// $this->$key = $val;
// }
// }
return $this; return $this;
} }