diff --git a/src/model/relation/OneToOne.php b/src/model/relation/OneToOne.php index c45489ed..7e6d8e19 100644 --- a/src/model/relation/OneToOne.php +++ b/src/model/relation/OneToOne.php @@ -90,9 +90,9 @@ public function eagerly(Query $query, string $relation, $field = true, string $j } // 预载入封装 - $joinTable = $this->query->getTable(); - $joinAlias = $relation; - $joinType = $joinType ?: $this->joinType; + $joinTable = $this->query->getTable(); + $joinAlias = $relation; + $joinType = $joinType ?: $this->joinType; $query->via($joinAlias); @@ -315,8 +315,8 @@ protected function match(string $model, string $relation, Model $result): void protected function bindAttr(Model $result, Model $model = null): void { foreach ($this->bindAttr as $key => $attr) { - $key = is_numeric($key) ? $attr : $key; - $value = $result->getOrigin($key); + $key = is_numeric($key) ? $attr : $key; + $value = $result->getOrigin($key); if (!is_null($value)) { throw new Exception('bind attr has exists:' . $key);