From 0347d7c2c329b284a1adf82cbf4ba8dc1f8c090b Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 9 Dec 2018 20:18:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index a33a5d44..2190e341 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1042,19 +1042,20 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $data = []; } - // 数据自动验证 - if (!$this->validateData($data)) { - return false; - } - // 数据对象赋值 - foreach ($data as $key => $value) { - $this->setAttr($key, $value, $data); - } - if (!empty($where)) { - $this->isUpdate = true; - $this->updateWhere = $where; - } + // 数据自动验证 + if (!$this->validateData($data)) { + return false; + } + + // 数据对象赋值 + foreach ($data as $key => $value) { + $this->setAttr($key, $value, $data); + } + if (!empty($where)) { + $this->isUpdate = true; + $this->updateWhere = $where; + } // 自动关联写入 if (!empty($this->relationWrite)) {