mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进Model类writeTransform方法
This commit is contained in:
@@ -397,9 +397,8 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
break;
|
||||
case 'datetime':
|
||||
$format = !empty($param) ? $param : $this->dateFormat;
|
||||
if (false === strpos($format, '\\')) {
|
||||
$value = date($format, is_numeric($value) ? $value : strtotime($value));
|
||||
}
|
||||
$value = is_numeric($value) ? $value : strtotime($value);
|
||||
$value = $this->formatDateTime($value, $format);
|
||||
break;
|
||||
case 'object':
|
||||
if (is_object($value)) {
|
||||
|
||||
Reference in New Issue
Block a user