diff --git a/library/think/model/relation/HasOne.php b/library/think/model/relation/HasOne.php index ec815969..ccec783c 100644 --- a/library/think/model/relation/HasOne.php +++ b/library/think/model/relation/HasOne.php @@ -103,7 +103,7 @@ class HasOne extends OneToOne return $this->parent->db()->alias($model) ->field($fields) - ->join($table . ' ' . $relation, $model . '.' . $this->localKey . '=' . $relation . '.' . $this->foreignKey, $this->joinType) + ->join([$table => $relation], $model . '.' . $this->localKey . '=' . $relation . '.' . $this->foreignKey, $this->joinType) ->where($where); }