Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Baum/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ public static function buildTree($nodeList) {
* @return \Illuminate\Database\Query\Builder
*/
public function scopeWithoutNode($query, $node) {
return $query->where($node->getKeyName(), '!=', $node->getKey());
return $query->where($node->getQualifiedKeyName(), '!=', $node->getKey());
}

/**
Expand Down Expand Up @@ -568,8 +568,8 @@ public function getRoot() {
*/
public function ancestorsAndSelf() {
return $this->newNestedSetQuery()
->where($this->getLeftColumnName(), '<=', $this->getLeft())
->where($this->getRightColumnName(), '>=', $this->getRight());
->where($this->getQualifiedLeftColumnName(), '<=', $this->getLeft())
->where($this->getQualifiedRightColumnName(), '>=', $this->getRight());
}

/**
Expand Down Expand Up @@ -723,8 +723,8 @@ public function getTrunks($columns = array('*')) {
*/
public function descendantsAndSelf() {
return $this->newNestedSetQuery()
->where($this->getLeftColumnName(), '>=', $this->getLeft())
->where($this->getLeftColumnName(), '<', $this->getRight());
->where($this->getQualifiedLeftColumnName(), '>=', $this->getLeft())
->where($this->getQualifiedLeftColumnName(), '<', $this->getRight());
}

/**
Expand Down