diff --git a/library/think/Model.php b/library/think/Model.php index 38a4935c..7f23f479 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -321,11 +321,12 @@ abstract class Model implements \JsonSerializable, \ArrayAccess $value = json_encode($value, JSON_FORCE_OBJECT); } break; - case 'json': + case 'array': - if (is_array($value)) { - $value = json_encode($value, JSON_UNESCAPED_UNICODE); - } + $value = (array) $value; + case 'json': + $value = json_encode($value, JSON_UNESCAPED_UNICODE); + break; } return $value;