laravel-nestedset icon indicating copy to clipboard operation
laravel-nestedset copied to clipboard

Ordering nodes by children or descendants count ?

Open NRD3v opened this issue 5 years ago • 0 comments

Hello.

I am wondering if it is possible to order nodes by number of children or descendants count ?

I have a list of organizations that belong to a head organization, but I would like to order the children by order of subsidiaries they possess.

Ex : Output from DB :

Main organization ----- Child one ---------- Grandchild one ---------- Grandchild two ----- Child two ---------- Grandchild three ---------- Grandchild four ---------- Grandchild five

I would like to display the array as such :

Main organization ----- Child two ---------- Grandchild three ---------- Grandchild four ---------- Grandchild five ----- Child one ---------- Grandchild one ---------- Grandchild two

Thanks a lot.

NRD3v avatar Sep 21 '20 05:09 NRD3v