mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进Model类的JSON类型转换 支持非数组类型
This commit is contained in:
@@ -321,11 +321,12 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
$value = json_encode($value, JSON_FORCE_OBJECT);
|
$value = json_encode($value, JSON_FORCE_OBJECT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'json':
|
|
||||||
case 'array':
|
case 'array':
|
||||||
if (is_array($value)) {
|
$value = (array) $value;
|
||||||
$value = json_encode($value, JSON_UNESCAPED_UNICODE);
|
case 'json':
|
||||||
}
|
$value = json_encode($value, JSON_UNESCAPED_UNICODE);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
|
|||||||
Reference in New Issue
Block a user