From 295b3a2cf34eb8127a5e5ca9257a91792c3dc560 Mon Sep 17 00:00:00 2001 From: Joel Salisbury Date: Thu, 16 Feb 2017 17:44:36 -0500 Subject: [PATCH] changes to all cats --- api/routes/category.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/routes/category.php b/api/routes/category.php index 1122017..edf756b 100644 --- a/api/routes/category.php +++ b/api/routes/category.php @@ -22,9 +22,9 @@ foreach( $cats as $cat ) { $q = new CategoryRankNutrientQuery; - $requestedCatRules = $q->filterByCategoryId($cat->getId())->find(); + $requestedCatRules = $q->filterByCategoryId($cat->getId())->orderByRankId()->find(); foreach($requestedCatRules as $rule) { - $rules[] = [ + $rules[$rule->getNutrient()->getName()][] = [ "nutrientName" => $rule->getNutrient()->getName(), "nutrientId" => $rule->getNutrient()->getId(), "operator" => $rule->getOperator(),