Skip to content

Commit c2682f6

Browse files
committed
Merge branch 'v4' of github.com:lazychaser/laravel-nestedset into v4
2 parents 65b08fb + c4a05f9 commit c2682f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/QueryBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ protected function getOdnessQuery()
715715
protected function getDuplicatesQuery()
716716
{
717717
$table = $this->wrappedTable();
718+
$keyName = $this->wrappedKey();
718719

719720
$firstAlias = 'c1';
720721
$secondAlias = 'c2';
@@ -726,7 +727,7 @@ protected function getDuplicatesQuery()
726727
->newNestedSetQuery($firstAlias)
727728
->toBase()
728729
->from($this->query->raw("{$table} as {$waFirst}, {$table} {$waSecond}"))
729-
->whereRaw("{$waFirst}.id < {$waSecond}.id")
730+
->whereRaw("{$waFirst}.{$keyName} < {$waSecond}.{$keyName}")
730731
->whereNested(function (BaseQueryBuilder $inner) use ($waFirst, $waSecond) {
731732
list($lft, $rgt) = $this->wrappedColumns();
732733

0 commit comments

Comments
 (0)