From 0556e391642001b397d71dcd6192e283c2d05dd9 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Mon, 23 May 2016 11:56:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E8=87=AA=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=88=B3=E5=86=99=E5=85=A5=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E5=85=B3=E9=97=AD=E6=9F=90=E4=B8=AA=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= 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 be01b26b..00f5a3f4 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -322,7 +322,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $this->autoCompleteData($this->auto); // 自动写入更新时间 - if ($this->autoWriteTimestamp) { + if ($this->autoWriteTimestamp && $this->updateTime) { $this->__set($this->updateTime, null); } @@ -368,7 +368,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $this->autoCompleteData($this->insert); // 自动写入创建时间 - if ($this->autoWriteTimestamp) { + if ($this->autoWriteTimestamp && $this->createTime) { $this->__set($this->createTime, null); } diff --git a/library/think/model/Merge.php b/library/think/model/Merge.php index 11548ae6..f34d8d3a 100644 --- a/library/think/model/Merge.php +++ b/library/think/model/Merge.php @@ -166,7 +166,7 @@ class Merge extends Model $this->autoCompleteData($this->auto); // 自动写入更新时间 - if ($this->autoWriteTimestamp) { + if ($this->autoWriteTimestamp && $this->updateTime) { $this->__set($this->updateTime, null); } @@ -202,7 +202,7 @@ class Merge extends Model $this->autoCompleteData($this->insert); // 自动写入创建时间 - if ($this->autoWriteTimestamp) { + if ($this->autoWriteTimestamp && $this->createTime) { $this->__set($this->createTime, null); }