ADD комментарии в коде; Уточнил выборку точек

This commit is contained in:
Krivchikov Dmitry 2016-04-08 16:52:31 +03:00
parent d99bbded8c
commit 26f9cc8752
3 changed files with 7 additions and 4 deletions

View File

@ -93,6 +93,9 @@ class App
} }
} }
/**
* @return null|PDO
*/
public static function DB() public static function DB()
{ {
if (self::$DB === NULL && self::getConfig('DB')) { if (self::$DB === NULL && self::getConfig('DB')) {

View File

@ -10,9 +10,9 @@ class Helper
/** /**
* TYPES: 'clear','html', 'editor','js' * TYPES: 'clear','html', 'editor','js'
* @param type $string * @param string $string
* @param type $replaceType * @param string $replaceType
* @return type * @return string
*/ */
public static function replaceLinks($string, $replaceType = 'clear') public static function replaceLinks($string, $replaceType = 'clear')
{ {

View File

@ -55,7 +55,7 @@ class FeedController extends Controller
// --------- AUTHORS // --------- AUTHORS
$authors = array(); $authors = array();
$authorIds = App::DB()->query('SELECT `author` , COUNT( * ) `cnt` FROM `points` GROUP BY `author` ORDER BY `cnt` DESC LIMIT 0 , 6')->fetchAll(PDO::FETCH_ASSOC); $authorIds = App::DB()->query('SELECT `author` , COUNT( * ) `cnt` FROM `points` WHERE `moderate`=1 GROUP BY `author` ORDER BY `cnt` DESC LIMIT 0 , 6')->fetchAll(PDO::FETCH_ASSOC);
foreach ($authorIds as $authorId) { foreach ($authorIds as $authorId) {
$author = User::model()->getByPK($authorId['author']); $author = User::model()->getByPK($authorId['author']);
$author->pointsCount = $authorId['cnt']; $author->pointsCount = $authorId['cnt'];