Points list
This commit is contained in:
parent
f4294405c6
commit
a79ed2eba5
|
|
@ -36,7 +36,11 @@ class PageController extends Controller
|
|||
// ------------------------------------------
|
||||
|
||||
$param['order']='id DESC';
|
||||
$param['where']=App::getParam('category') ? 'categoryId = '.(int)App::getParam('category') : '';
|
||||
if (App::getParam('category')) {
|
||||
$param['where'] = 'categoryId = '.(int)App::getParam('category');
|
||||
} else {
|
||||
$param['limit'] = 100;
|
||||
}
|
||||
$points = Point::model()->getAll($param);
|
||||
$categories = Category::model()->getAll(array('order' => 'ord ASC'));
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,14 @@ foreach ($categories as $category) {
|
|||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
$header = 'Неплоный список точек (100 недавно добавленных)';
|
||||
if ((int)App::getParam('category')) {
|
||||
$header = 'Список точек в категории "'.$categories[(int)App::getParam('category')]->name.'"';
|
||||
}
|
||||
|
||||
<h3>Список точек</h3>
|
||||
?>
|
||||
<h3><?=$header?></h3>
|
||||
|
||||
<?php foreach ($points as $point): ?>
|
||||
#<?=$point['id']?> <img src="<?=$point['categoryIcon']?>" /> <a href="/page/point/id/<?=$point['id']?>"><?=$point['name']?></a>
|
||||
|
|
|
|||
Loading…
Reference in New Issue