From 1914f564fbe4c58d1b6ea1c269a49ace761416d0 Mon Sep 17 00:00:00 2001 From: Finn Date: Wed, 24 Jan 2018 13:19:35 +0000 Subject: [PATCH] category purchase list fully grouped --- lib/Pear/LocalLoop/Controller/Api/Categories.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Pear/LocalLoop/Controller/Api/Categories.pm b/lib/Pear/LocalLoop/Controller/Api/Categories.pm index 6412dfc..8e52d4b 100644 --- a/lib/Pear/LocalLoop/Controller/Api/Categories.pm +++ b/lib/Pear/LocalLoop/Controller/Api/Categories.pm @@ -1,7 +1,7 @@ package Pear::LocalLoop::Controller::Api::Categories; use Mojo::Base 'Mojolicious::Controller'; -use List::Util qw/ max sum /; +use List::Util qw/ max /; sub post_category_list { my $c = shift; @@ -32,6 +32,7 @@ sub post_category_list { category_id => 'category_id', } ], + group_by => [ qw/ category_id quantised_weeks / ], order_by => { '-desc' => 'quantised_weeks' }, } );