Порядок следования категорий в приложении

This commit is contained in:
Krivchikov Dmitry 2016-04-12 13:58:58 +03:00
parent de9d8409eb
commit ce23eb6680
1 changed files with 3 additions and 1 deletions

View File

@ -102,7 +102,7 @@ class JsonController extends Controller
*/
static function actionCategories()
{
$categories = Category::model()->getAll(array('order' => 'ord ASC', 'asArray' => true, 'noKeys' => true));
$categories = Category::model()->getAll(array('order' => 'ord DESC', 'asArray' => true, 'noKeys' => true));
$categories[] = array(
"id" => "0",
@ -111,6 +111,8 @@ class JsonController extends Controller
"ord" => "0"
);
$categories = array_reverse($categories);
self::renderPartial('json.php', array(
'data' => $categories,
));