diff --git a/src/Baum/Node.php b/src/Baum/Node.php index 8dcab130..238b6e15 100644 --- a/src/Baum/Node.php +++ b/src/Baum/Node.php @@ -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()); } /** @@ -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()); } /** @@ -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()); } /**