diff --git a/ground/controllers/JsonController.php b/ground/controllers/JsonController.php index 795f421..b8bff34 100644 --- a/ground/controllers/JsonController.php +++ b/ground/controllers/JsonController.php @@ -9,7 +9,7 @@ class JsonController extends Controller static function actionPoints() { $points = Point::model()->getAll(); - $categories = Category::model()->getAll(array('asArray'=>true)); + $categories = Category::model()->getAll(array('order' => 'ord ASC', 'asArray' => true)); $result = array(); @@ -41,9 +41,9 @@ class JsonController extends Controller $point->descriptionHtml = nl2br($point->description); $point->name = htmlspecialchars($point->name); - $categories = Category::model()->getAll(array('asArray'=>true)); + $categories = Category::model()->getAll(array('order' => 'ord ASC', 'asArray' => true)); - $point->categoryIcon = $categories[$point->categoryId]['icon']; + $point->categoryIcon = $categories[$point->categoryId]['icon']; $point->categoryName = $categories[$point->categoryId]['name']; self::renderPartial('json.php', $point->getValues()); @@ -58,9 +58,9 @@ class JsonController extends Controller */ static function actionCategories() { - $categories = Category::model()->getAll(array('asArray'=>true)); + $categories = Category::model()->getAll(array('order' => 'ord ASC', 'asArray' => true)); - self::renderPartial('json.php', array( + self::renderPartial('json.php', array( 'data' => $categories, )); } diff --git a/ground/controllers/PageController.php b/ground/controllers/PageController.php index 46d4637..9217e40 100644 --- a/ground/controllers/PageController.php +++ b/ground/controllers/PageController.php @@ -15,7 +15,7 @@ class PageController extends Controller $param['order']='id DESC'; $param['where']=App::getParam('category') ? 'categoryId = '.(int)App::getParam('category') : ''; $points = Point::model()->getAll($param); - $categories = Category::model()->getAll(); + $categories = Category::model()->getAll(array('order' => 'ord ASC')); $result = array(); @@ -25,8 +25,8 @@ class PageController extends Controller $result[$id]['name'] = $point->name; $result[$id]['lat'] = $point->lat; $result[$id]['lng'] = $point->lng; - $result[$id]['author'] = $point->authorUser->name; - $result[$id]['categoryId'] = $point->categoryId; + $result[$id]['author'] = $point->authorUser->nick; + $result[$id]['categoryId'] = $point->categoryId; $result[$id]['categoryIcon'] = $categories[$point->categoryId]->icon; } @@ -61,7 +61,7 @@ class PageController extends Controller $point->descriptionHtml = nl2br($point->description); $point->name = htmlspecialchars($point->name); - $categories = Category::model()->getAll(array('asArray' => true)); + $categories = Category::model()->getAll(array('order' => 'ord ASC', 'asArray' => true)); $point->categoryIcon = $categories[$point->categoryId]['icon']; $point->categoryName = $categories[$point->categoryId]['name'];