This commit is contained in:
thinkphp
2017-03-10 22:11:02 +08:00
parent e0f2d12c20
commit af635db08f

View File

@@ -870,13 +870,12 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
}
}
if (!empty($data)) {
if ($this->autoWriteTimestamp && $this->updateTime && !isset($data[$this->updateTime])) {
// 自动写入更新时间
$data[$this->updateTime] = $this->autoWriteTimestamp($this->updateTime);
}
} else {
if (empty($data) || (count($data) == 1 && is_string($pk) && isset($data[$pk]))) {
// 没有更新
return 0;
} elseif ($this->autoWriteTimestamp && $this->updateTime && !isset($data[$this->updateTime])) {
// 自动写入更新时间
$data[$this->updateTime] = $this->autoWriteTimestamp($this->updateTime);
}
if (empty($where) && !empty($this->updateWhere)) {