代码规范

This commit is contained in:
thinkphp
2018-12-09 20:18:16 +08:00
parent b797d72352
commit 0347d7c2c3

View File

@@ -1042,19 +1042,20 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
$data = []; $data = [];
} }
// 数据自动验证 // 数据自动验证
if (!$this->validateData($data)) { if (!$this->validateData($data)) {
return false; return false;
} }
// 数据对象赋值
foreach ($data as $key => $value) { // 数据对象赋值
$this->setAttr($key, $value, $data); foreach ($data as $key => $value) {
} $this->setAttr($key, $value, $data);
if (!empty($where)) { }
$this->isUpdate = true;
$this->updateWhere = $where;
}
if (!empty($where)) {
$this->isUpdate = true;
$this->updateWhere = $where;
}
// 自动关联写入 // 自动关联写入
if (!empty($this->relationWrite)) { if (!empty($this->relationWrite)) {