mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
自动时间字段(create_time 和 update_time)的获取自动使用时间格式化
This commit is contained in:
@@ -437,6 +437,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
} elseif (isset($this->type[$name])) {
|
} elseif (isset($this->type[$name])) {
|
||||||
// 类型转换
|
// 类型转换
|
||||||
$value = $this->readTransform($value, $this->type[$name]);
|
$value = $this->readTransform($value, $this->type[$name]);
|
||||||
|
} elseif (in_array($name, [$this->createTime, $this->updateTime])) {
|
||||||
|
$value = $this->formatDateTime($value, $this->dateFormat);
|
||||||
} elseif ($notFound) {
|
} elseif ($notFound) {
|
||||||
$method = Loader::parseName($name, 1, false);
|
$method = Loader::parseName($name, 1, false);
|
||||||
if (method_exists($this, $method) && $this->$method() instanceof Relation) {
|
if (method_exists($this, $method) && $this->$method() instanceof Relation) {
|
||||||
|
|||||||
Reference in New Issue
Block a user