From 46589692eb3149eef9cc93fa36da5414803b7030 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 7 Jun 2017 12:58:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E7=B1=BB=E5=A2=9E=E5=8A=A0au?= =?UTF-8?q?toWriteTimestamp=E6=96=B9=E6=B3=95=E5=8A=A8=E6=80=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5=E5=86=99=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Model.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/think/Model.php b/library/think/Model.php index 386ddaea..301c7f1c 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -324,6 +324,17 @@ abstract class Model implements \JsonSerializable, \ArrayAccess } } + /** + * 是否需要自动写入时间字段 + * @access public + * @param bool $auto + * @return $this + */ + public function autoWriteTimestamp($auto){ + $this->autoWriteTimestamp = $auto; + return $this; + } + /** * 修改器 设置数据对象值 * @access public