Из ленты и списка точек убраны платные точки

This commit is contained in:
Krivchikov Dmitry 2016-01-07 17:27:45 +03:00
parent 7388643a15
commit 9e9edea8e4
3 changed files with 4 additions and 4 deletions

View File

@ -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,
));

View File

@ -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);

View File

@ -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())
{