mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
增加时间戳自动写入的判断
This commit is contained in:
@@ -726,7 +726,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
$this->autoCompleteData($this->auto);
|
||||
|
||||
// 自动写入更新时间
|
||||
if ($this->autoWriteTimestamp && $this->updateTime) {
|
||||
if ($this->autoWriteTimestamp && $this->updateTime && !isset($this->data[$this->updateTime])) {
|
||||
$this->setAttr($this->updateTime, null);
|
||||
}
|
||||
|
||||
@@ -783,7 +783,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
$this->autoCompleteData($this->insert);
|
||||
|
||||
// 自动写入创建时间
|
||||
if ($this->autoWriteTimestamp && $this->createTime) {
|
||||
if ($this->autoWriteTimestamp && $this->createTime && !isset($this->data[$this->createTime])) {
|
||||
$this->setAttr($this->createTime, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ class Merge extends Model
|
||||
$this->autoCompleteData($this->auto);
|
||||
|
||||
// 自动写入更新时间
|
||||
if ($this->autoWriteTimestamp && $this->updateTime) {
|
||||
if ($this->autoWriteTimestamp && $this->updateTime && !isset($this->data[$this->updateTime])) {
|
||||
$this->setAttr($this->updateTime, null);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ class Merge extends Model
|
||||
$this->autoCompleteData($this->insert);
|
||||
|
||||
// 自动写入创建时间
|
||||
if ($this->autoWriteTimestamp && $this->createTime) {
|
||||
if ($this->autoWriteTimestamp && $this->createTime && !isset($this->data[$this->createTime])) {
|
||||
$this->setAttr($this->createTime, null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user