diff --git a/NestedSetsQueryBehavior.php b/NestedSetsQueryBehavior.php index 0300dab..f1f06b2 100644 --- a/NestedSetsQueryBehavior.php +++ b/NestedSetsQueryBehavior.php @@ -41,7 +41,7 @@ class NestedSetsQueryBehavior extends Behavior $this->owner->andWhere(new Expression( $db->quoteColumnName($model->rightAttribute) . ' - ' . $db->quoteColumnName($model->leftAttribute) . ' = 1' - )); + ))->addOrderBy([$model->rightAttribute => SORT_ASC]); return $this->owner; }