From 8f39a8ef7cf23e9a498670bfe3a50109311f2023 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 4 Jan 2017 12:41:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=97=B6=E9=97=B4=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=88create=5Ftime=20=E5=92=8C=20update=5Ftime?= =?UTF-8?q?=EF=BC=89=E7=9A=84=E8=8E=B7=E5=8F=96=E8=87=AA=E5=8A=A8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/think/Model.php b/library/think/Model.php index 76bc2d36..b520f801 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -437,6 +437,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess } elseif (isset($this->type[$name])) { // 类型转换 $value = $this->readTransform($value, $this->type[$name]); + } elseif (in_array($name, [$this->createTime, $this->updateTime])) { + $value = $this->formatDateTime($value, $this->dateFormat); } elseif ($notFound) { $method = Loader::parseName($name, 1, false); if (method_exists($this, $method) && $this->$method() instanceof Relation) {