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()
|
||||
{
|
||||
if (self::$DB === NULL && self::getConfig('DB')) {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ class Helper
|
|||
|
||||
/**
|
||||
* TYPES: 'clear','html', 'editor','js'
|
||||
* @param type $string
|
||||
* @param type $replaceType
|
||||
* @return type
|
||||
* @param string $string
|
||||
* @param string $replaceType
|
||||
* @return string
|
||||
*/
|
||||
public static function replaceLinks($string, $replaceType = 'clear')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class FeedController extends Controller
|
|||
|
||||
// --------- AUTHORS
|
||||
$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) {
|
||||
$author = User::model()->getByPK($authorId['author']);
|
||||
$author->pointsCount = $authorId['cnt'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue