Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fico7489 committed Jan 20, 2019
1 parent 9db28c3 commit 773e39f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/EloquentJoinBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ private function performJoin($relations, $leftJoin = null)

$currentModel = $baseModel;
$currentTableAlias = $baseTable;
$currentPrimaryKey = $baseModel->getKeyName();

$relationsAccumulated = [];
foreach ($relations as $relation) {
Expand Down Expand Up @@ -164,7 +163,7 @@ private function performJoin($relations, $leftJoin = null)
$localKey = $relatedRelation->getQualifiedParentKeyName();
$localKey = last(explode('.', $localKey));

$this->$joinMethod($joinQuery, function ($join) use ($relatedRelation, $relatedTableAlias, $relatedKey, $currentTableAlias, $currentPrimaryKey, $localKey) {
$this->$joinMethod($joinQuery, function ($join) use ($relatedRelation, $relatedTableAlias, $relatedKey, $currentTableAlias, $localKey) {
$join->on($relatedTableAlias.'.'.$relatedKey, '=', $currentTableAlias.'.'.$localKey);

$this->joinQuery($join, $relatedRelation, $relatedTableAlias);
Expand All @@ -176,7 +175,6 @@ private function performJoin($relations, $leftJoin = null)

$currentModel = $relatedModel;
$currentTableAlias = $relatedTableAlias;
$currentPrimaryKey = $relatedPrimaryKey;

$this->joinedTables[] = implode('_', $relationsAccumulated);
}
Expand Down

0 comments on commit 773e39f

Please sign in to comment.