diff --git a/PhpRbac/src/PhpRbac/core/lib/nestedset/full.php b/PhpRbac/src/PhpRbac/core/lib/nestedset/full.php index b2a2616..1188a0c 100644 --- a/PhpRbac/src/PhpRbac/core/lib/nestedset/full.php +++ b/PhpRbac/src/PhpRbac/core/lib/nestedset/full.php @@ -227,7 +227,7 @@ function deleteSubtreeConditional($ConditionString,$Rest=null) function descendantsConditional($AbsoluteDepths=false,$ConditionString,$Rest=null) { if (!$AbsoluteDepths) - $DepthConcat="- (sub_tree.innerDepth )"; + $DepthConcat="- (GROUP_CONCAT(sub_tree.innerDepth) )"; $Arguments=func_get_args(); array_shift($Arguments); array_shift($Arguments); //second argument, $AbsoluteDepths @@ -271,7 +271,7 @@ function childrenConditional($ConditionString,$Rest=null) $Arguments=func_get_args(); array_shift($Arguments); $Query=" - SELECT node.*, (COUNT(parent.{$this->id()})-1 - (sub_tree.innerDepth )) AS Depth + SELECT node.*, (COUNT(parent.{$this->id()})-1 - (GROUP_CONCAT(sub_tree.innerDepth) )) AS Depth FROM {$this->table()} AS node, {$this->table()} AS parent, {$this->table()} AS sub_parent, @@ -491,4 +491,4 @@ function editData($FieldValueArray=array(),$ConditionString=null,$Rest=null) } -?> \ No newline at end of file +?>