mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +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);
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ class Merge extends Model
|
||||
$this->autoCompleteData($this->auto);
|
||||
|
||||
// 自动写入更新时间
|
||||
if ($this->autoWriteTimestamp) {
|
||||
if ($this->autoWriteTimestamp && $this->updateTime) {
|
||||
$this->__set($this->updateTime, null);
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ class Merge extends Model
|
||||
$this->autoCompleteData($this->insert);
|
||||
|
||||
// 自动写入创建时间
|
||||
if ($this->autoWriteTimestamp) {
|
||||
if ($this->autoWriteTimestamp && $this->createTime) {
|
||||
$this->__set($this->createTime, null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user