category purchase list fully grouped
This commit is contained in:
parent
4aae7fb3ea
commit
1914f564fb
1 changed files with 2 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
package Pear::LocalLoop::Controller::Api::Categories;
|
package Pear::LocalLoop::Controller::Api::Categories;
|
||||||
use Mojo::Base 'Mojolicious::Controller';
|
use Mojo::Base 'Mojolicious::Controller';
|
||||||
|
|
||||||
use List::Util qw/ max sum /;
|
use List::Util qw/ max /;
|
||||||
|
|
||||||
sub post_category_list {
|
sub post_category_list {
|
||||||
my $c = shift;
|
my $c = shift;
|
||||||
|
@ -32,6 +32,7 @@ sub post_category_list {
|
||||||
category_id => 'category_id',
|
category_id => 'category_id',
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
group_by => [ qw/ category_id quantised_weeks / ],
|
||||||
order_by => { '-desc' => 'quantised_weeks' },
|
order_by => { '-desc' => 'quantised_weeks' },
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Reference in a new issue