自动添加时间
在模型中:
protected $autoWriteTimestamp='datetime';
// protected $autoWriteTimestamp='true';//时间戳
protected $updateTime='update_at';
或在全局更改:
// 'auto_timestamp' => true,//时间戳
'auto_timestamp' => 'datetime',
// 时间字段取出后的默认时间格式
'datetime_format' => 'Y-m-d H:i:s',
如果区别对待可以加上:
.....->isAutoWriteTimestamp(false)->.....;