From c33cc2991b6280f1ad63a9d5eb5d80f8143cadd6 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 23 Dec 2016 11:37:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=86=99=E5=85=A5=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 4 ++-- library/think/model/Merge.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/think/Model.php b/library/think/Model.php index fb2f5abf..d8e76ce6 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -726,7 +726,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $this->autoCompleteData($this->auto); // 自动写入更新时间 - if ($this->autoWriteTimestamp && $this->updateTime) { + if ($this->autoWriteTimestamp && $this->updateTime && !isset($this->data[$this->updateTime])) { $this->setAttr($this->updateTime, null); } @@ -783,7 +783,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $this->autoCompleteData($this->insert); // 自动写入创建时间 - if ($this->autoWriteTimestamp && $this->createTime) { + if ($this->autoWriteTimestamp && $this->createTime && !isset($this->data[$this->createTime])) { $this->setAttr($this->createTime, null); } diff --git a/library/think/model/Merge.php b/library/think/model/Merge.php index 3cf5c3f6..5edb2a45 100644 --- a/library/think/model/Merge.php +++ b/library/think/model/Merge.php @@ -169,7 +169,7 @@ class Merge extends Model $this->autoCompleteData($this->auto); // 自动写入更新时间 - if ($this->autoWriteTimestamp && $this->updateTime) { + if ($this->autoWriteTimestamp && $this->updateTime && !isset($this->data[$this->updateTime])) { $this->setAttr($this->updateTime, null); } @@ -221,7 +221,7 @@ class Merge extends Model $this->autoCompleteData($this->insert); // 自动写入创建时间 - if ($this->autoWriteTimestamp && $this->createTime) { + if ($this->autoWriteTimestamp && $this->createTime && !isset($this->data[$this->createTime])) { $this->setAttr($this->createTime, null); }