asprin
Active member
For a table having data as the following:
I'm using the following query and grouping by
This is giving me the following output:
This is correct representation of grouping but is there a way I can order them by the array count so that it looks something like this?
user_id |
---|
2 |
4 |
1 |
5 |
6 |
3 |
1 |
6 |
I'm using the following query and grouping by
user_id
PHP:
$d = \XF::finder('Asprin\FB:Foo')->fetch();
$grouped = $d->groupBy('user_id');
\XF::dump($grouped);
This is giving me the following output:
Code:
array:6 [▼
6 => array:2 [▶]
5 => array:1 [▶]
4 => array:1 [▶]
3 => array:1 [▶]
2 => array:1 [▶]
1 => array:2 [▶]
]
This is correct representation of grouping but is there a way I can order them by the array count so that it looks something like this?
Code:
array:6 [▼
6 => array:2 [▶]
1 => array:2 [▶]
4 => array:1 [▶]
3 => array:1 [▶]
2 => array:1 [▶]
5 => array:1 [▶]
]