mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-03 14:02:47 +08:00
改进自动时间戳写入 支持单独关闭某个字段
This commit is contained in:
@@ -322,7 +322,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
$this->autoCompleteData($this->auto);
|
||||
|
||||
// 自动写入更新时间
|
||||
if ($this->autoWriteTimestamp) {
|
||||
if ($this->autoWriteTimestamp && $this->updateTime) {
|
||||
$this->__set($this->updateTime, null);
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
$this->autoCompleteData($this->insert);
|
||||
|
||||
// 自动写入创建时间
|
||||
if ($this->autoWriteTimestamp) {
|
||||
if ($this->autoWriteTimestamp && $this->createTime) {
|
||||
$this->__set($this->createTime, null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user