Skip to content

Commit

Permalink
Merge pull request #58 from pascalbaljet/performance
Browse files Browse the repository at this point in the history
Performance update: using 'whereColumn' instead of 'groupBy' in the Query Scopes
  • Loading branch information
freekmurze authored Jun 11, 2019
2 parents 34c67ea + 9ed02c8 commit 11e79bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HasStatuses.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function (QueryBuilder $query) {
->select(DB::raw('max(id)'))
->from($this->getStatusTableName())
->where('model_type', $this->getStatusModelType())
->groupBy($this->getModelKeyColumnName());
->whereColumn($this->getModelKeyColumnName(), $this->getQualifiedKeyName());
}
);
}
Expand Down Expand Up @@ -100,7 +100,7 @@ function (QueryBuilder $query) use ($names) {
->select(DB::raw('max(id)'))
->from($this->getStatusTableName())
->where('model_type', $this->getStatusModelType())
->groupBy($this->getModelKeyColumnName());
->whereColumn($this->getModelKeyColumnName(), $this->getQualifiedKeyName());
}
);
}
Expand Down

0 comments on commit 11e79bd

Please sign in to comment.