mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-09-03 05:41:38 +08:00
增加 database.auto_timestamp 配置参数用于配置是否需要自动写入时间戳字段
This commit is contained in:
@@ -64,7 +64,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
// 更新自动完成列表
|
||||
protected $update = [];
|
||||
// 是否需要自动写入时间戳
|
||||
protected $autoWriteTimestamp = true;
|
||||
protected $autoWriteTimestamp;
|
||||
// 创建时间字段
|
||||
protected $createTime = 'create_time';
|
||||
// 更新时间字段
|
||||
@@ -111,6 +111,10 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
$this->name = basename(str_replace('\\', '/', $this->class));
|
||||
}
|
||||
|
||||
if (is_null($this->autoWriteTimestamp)) {
|
||||
$this->autoWriteTimestamp = $this->getConfig('auto_timestamp');
|
||||
}
|
||||
|
||||
// 执行初始化操作
|
||||
$this->initialize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user