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