From a77e5d8ec88e8ff282beebd15ebe0742d699476e Mon Sep 17 00:00:00 2001 From: Karson Date: Tue, 19 Dec 2017 00:49:53 +0800 Subject: [PATCH] Update HasOne.php --- library/think/model/relation/HasOne.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }