ADD комментарии в коде; Уточнил выборку точек
This commit is contained in:
parent
d99bbded8c
commit
26f9cc8752
3
app.php
3
app.php
|
|
@ -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')) {
|
||||||
|
|
|
||||||
|
|
@ -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')
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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'];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue