Update HasOne.php

This commit is contained in:
Karson
2017-12-19 00:49:53 +08:00
committed by ThinkPHP
parent d6da940d20
commit a77e5d8ec8

View File

@@ -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);
}