mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进命令行模式下自动完成的时间写入问题
This commit is contained in:
@@ -380,12 +380,12 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
case 'datetime':
|
case 'datetime':
|
||||||
case 'date':
|
case 'date':
|
||||||
$format = !empty($param) ? $param : $this->dateFormat;
|
$format = !empty($param) ? $param : $this->dateFormat;
|
||||||
$value = $this->formatDateTime($_SERVER['REQUEST_TIME'], $format);
|
$value = $this->formatDateTime(time(), $format);
|
||||||
break;
|
break;
|
||||||
case 'timestamp':
|
case 'timestamp':
|
||||||
case 'integer':
|
case 'integer':
|
||||||
default:
|
default:
|
||||||
$value = $_SERVER['REQUEST_TIME'];
|
$value = time();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} elseif (is_string($this->autoWriteTimestamp) && in_array(strtolower($this->autoWriteTimestamp), [
|
} elseif (is_string($this->autoWriteTimestamp) && in_array(strtolower($this->autoWriteTimestamp), [
|
||||||
@@ -394,9 +394,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
'timestamp',
|
'timestamp',
|
||||||
])
|
])
|
||||||
) {
|
) {
|
||||||
$value = $this->formatDateTime($_SERVER['REQUEST_TIME'], $this->dateFormat);
|
$value = $this->formatDateTime(time(), $this->dateFormat);
|
||||||
} else {
|
} else {
|
||||||
$value = $this->formatDateTime($_SERVER['REQUEST_TIME'], $this->dateFormat, true);
|
$value = $this->formatDateTime(time(), $this->dateFormat, true);
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user