FIX - сортировка, вывод ника вместо имени

This commit is contained in:
Krivchikov Dmitry 2014-07-27 01:26:47 +04:00
parent eab2a90b34
commit 93ba81e0d9
2 changed files with 9 additions and 9 deletions

View File

@ -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,7 +41,7 @@ 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->categoryName = $categories[$point->categoryId]['name'];
@ -58,7 +58,7 @@ 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(
'data' => $categories,

View File

@ -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,7 +25,7 @@ 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]['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'];