Skip to content

Commit

Permalink
Update RelationMixin.php
Browse files Browse the repository at this point in the history
  • Loading branch information
biiiiiigmonster authored Dec 22, 2020
1 parent 3359163 commit f77e6f7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Database/Eloquent/RelationMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ public function getRelationInQuery(): Closure
$hasManyThrough = function (Builder $query, Builder $parentQuery, $columns = ['*']): Builder{
/** @var HasManyThrough $this */
$columns = $columns == ['*'] ? $this->getQualifiedFirstKeyName() : $columns;
if ($parentQuery->getQuery()->from === $query->getQuery()->from) {
return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns);
}
// if ($parentQuery->getQuery()->from === $query->getQuery()->from) {
// TODO
// return $this->getRelationExistenceQueryForSelfRelation($query, $parentQuery, $columns);
// }

if ($parentQuery->getQuery()->from === $this->throughParent->getTable()) {
return $this->getRelationExistenceQueryForThroughSelfRelation($query, $parentQuery, $columns);
}
// if ($parentQuery->getQuery()->from === $this->throughParent->getTable()) {
// TODO
// return $this->getRelationExistenceQueryForThroughSelfRelation($query, $parentQuery, $columns);
// }

$this->performJoin($query);

Expand Down

0 comments on commit f77e6f7

Please sign in to comment.