From d6da940d20f2a5986e55028da92587d5cd41f45f Mon Sep 17 00:00:00 2001 From: Karson Date: Tue, 19 Dec 2017 00:49:25 +0800 Subject: [PATCH] Update BelongsTo.php --- library/think/model/relation/BelongsTo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/model/relation/BelongsTo.php b/library/think/model/relation/BelongsTo.php index 415c0c36..b5753ea3 100644 --- a/library/think/model/relation/BelongsTo.php +++ b/library/think/model/relation/BelongsTo.php @@ -102,7 +102,7 @@ class BelongsTo extends OneToOne return $this->parent->db()->alias($model) ->field($fields) ->group($model . '.' . $this->foreignKey) - ->join($table . ' ' . $relation, $model . '.' . $this->foreignKey . '=' . $relation . '.' . $this->localKey, $this->joinType) + ->join([$table => $relation], $model . '.' . $this->foreignKey . '=' . $relation . '.' . $this->localKey, $this->joinType) ->where($where); }