diff --git a/src/model/concern/Conversion.php b/src/model/concern/Conversion.php index cdfcb86c..a26d8e52 100644 --- a/src/model/concern/Conversion.php +++ b/src/model/concern/Conversion.php @@ -264,7 +264,7 @@ public function toArray(): array $val->hidden($hidden[$key], true); } // 关联模型对象 - if (array_key_exists($key,$this->with) && (!isset($hidden[$key]) || true !== $hidden[$key])) { + if (array_key_exists($key, $this->with) && (!isset($hidden[$key]) || true !== $hidden[$key])) { $item[$key] = $val->toArray(); } } elseif (isset($visible[$key])) { diff --git a/src/model/concern/RelationShip.php b/src/model/concern/RelationShip.php index 6d63e7d4..06b8b028 100644 --- a/src/model/concern/RelationShip.php +++ b/src/model/concern/RelationShip.php @@ -55,7 +55,7 @@ trait RelationShip * 预载入关联模型 * * @var array - */ + */ protected $with = []; /**