Из ленты и списка точек убраны платные точки
This commit is contained in:
parent
7388643a15
commit
9e9edea8e4
|
|
@ -22,7 +22,7 @@ class FeedController extends Controller
|
|||
|
||||
// --------- POINTS
|
||||
$points = Point::model()->getAll(array(
|
||||
'where' => '`status` = "published"',
|
||||
'where' => '`status` = "published" AND `categoryId` NOT IN ('. implode(',', Category::$paidIds).')',
|
||||
'order' => '`ord` DESC',
|
||||
'limit' => 5,
|
||||
));
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class PageController extends Controller
|
|||
// ------------------------------------------
|
||||
|
||||
$param = array();
|
||||
$param['where'] = '`status` = "published"';
|
||||
$param['where'] = '`status` = "published" AND `categoryId` NOT IN ('. implode(',', Category::$paidIds).')';
|
||||
$pointsCount = Point::model()->getCount($param);
|
||||
$pagesCount = intval(ceil($pointsCount/self::elementsByPage));
|
||||
$page = isset($_GET['page']) ? abs((int)$_GET['page']) : $pagesCount;
|
||||
|
|
@ -81,7 +81,7 @@ class PageController extends Controller
|
|||
} else if (App::getParam('user')) {
|
||||
$param['where'] = '`author` = ' . (int) App::getParam('user') . ' AND `status` = "published"';
|
||||
} else {
|
||||
$param['where'] = '`status` = "published"';
|
||||
$param['where'] = '`status` = "published" AND `categoryId` NOT IN ('. implode(',', Category::$paidIds).')';
|
||||
$param['limit'] = self::elementsByPage;
|
||||
if($page) {
|
||||
$param['offset'] = self::elementsByPage * ($pagesCount - $page);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
class Category extends Model
|
||||
{
|
||||
private static $categories = NULL;
|
||||
private static $paidIds = array(24,25);
|
||||
public static $paidIds = array(24,25);
|
||||
|
||||
function __construct($fromArray = array())
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue