改进HasMany和OneToOne

This commit is contained in:
thinkphp
2017-01-17 10:53:14 +08:00
parent ebfcbac863
commit ed3becf64f
3 changed files with 21 additions and 8 deletions

View File

@@ -245,7 +245,7 @@ class HasMany extends Relation
}
return $this->parent->db()->alias($model)
->field($model . '.*')
->join($table . ' ' . $relation, $model . '.' . $this->localKey . '=' . $relation . '.' . $this->foreignKey, $this->joinType)
->join($table . ' ' . $relation, $model . '.' . $this->localKey . '=' . $relation . '.' . $this->foreignKey)
->where($where);
}