改进Model类的autoWriteTimestamp方法

This commit is contained in:
thinkphp
2016-09-02 15:10:22 +08:00
parent 8cccde2062
commit 64c3c73d76

View File

@@ -321,6 +321,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
}
switch ($type) {
case 'datetime':
case 'date':
$format = !empty($param) ? $param : $this->dateFormat;
$value = date($format, $_SERVER['REQUEST_TIME']);
break;