diff --git a/library/think/Model.php b/library/think/Model.php index d9354881..cc34c1fe 100644 --- a/library/think/Model.php +++ b/library/think/Model.php @@ -173,6 +173,11 @@ abstract class Model implements \JsonSerializable, \ArrayAccess case 'boolean': $value = (bool) $value; break; + case 'array': + if (is_array($value)) { + $value = json_encode($value, JSON_UNESCAPED_UNICODE); + } + break; } } @@ -207,6 +212,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess case 'boolean': $value = (bool) $value; break; + case 'array': + $value = json_decode($value, true); + break; } }