From 094dde5d8d0ef3ebdc14df1f57138bdb13133168 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 5 Jul 2017 13:49:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3allowfield=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=BD=B1=E5=93=8D=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5=E5=86=99?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/think/Model.php b/library/think/Model.php index f5de46bc..7420d563 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -1099,6 +1099,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $field = $this->field; } elseif (!empty($this->field)) { $field = array_merge($this->field, $auto); + if ($this->autoWriteTimestamp) { + array_push($field, $this->createTime, $this->updateTime); + } } else { $field = []; }