FIX - сортировка, вывод ника вместо имени
This commit is contained in:
parent
eab2a90b34
commit
93ba81e0d9
|
|
@ -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,
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue