We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 65b08fb + c4a05f9 commit c2682f6Copy full SHA for c2682f6
src/QueryBuilder.php
@@ -715,6 +715,7 @@ protected function getOdnessQuery()
715
protected function getDuplicatesQuery()
716
{
717
$table = $this->wrappedTable();
718
+ $keyName = $this->wrappedKey();
719
720
$firstAlias = 'c1';
721
$secondAlias = 'c2';
@@ -726,7 +727,7 @@ protected function getDuplicatesQuery()
726
727
->newNestedSetQuery($firstAlias)
728
->toBase()
729
->from($this->query->raw("{$table} as {$waFirst}, {$table} {$waSecond}"))
- ->whereRaw("{$waFirst}.id < {$waSecond}.id")
730
+ ->whereRaw("{$waFirst}.{$keyName} < {$waSecond}.{$keyName}")
731
->whereNested(function (BaseQueryBuilder $inner) use ($waFirst, $waSecond) {
732
list($lft, $rgt) = $this->wrappedColumns();
733
0 commit comments