diff --git a/src/model/concern/Attribute.php b/src/model/concern/Attribute.php index b529fa39..d349f730 100644 --- a/src/model/concern/Attribute.php +++ b/src/model/concern/Attribute.php @@ -418,7 +418,7 @@ public function setAttr(string $name, $value, array $data = []): void if (is_null($value) && $array !== $this->data) { return; } - } elseif (isset($this->type[$name])) { + } elseif (!in_array($name, $this->json) && isset($this->type[$name])) { // 类型转换 $value = $this->writeTransform($value, $this->type[$name]); } elseif ($this->isRelationAttr($name)) {