FIX подсчёт кол-ва созданных точек - теперь только опубликованные

This commit is contained in:
Krivchikov Dmitry 2015-11-16 00:07:38 +03:00
parent b7aeda4d45
commit 2702b69a03
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ class Point extends Model
public function getCountByUser($userId) public function getCountByUser($userId)
{ {
$res = App::DB()->query('SELECT count(`id`) AS `cnt` FROM ' . $this->_tableName_ . ' WHERE `author` = ' . $userId . ' ;')->fetch(PDO::FETCH_ASSOC); $res = App::DB()->query('SELECT count(`id`) AS `cnt` FROM ' . $this->_tableName_ . ' WHERE `author` = ' . $userId . ' AND `moderate` = 1 ;')->fetch(PDO::FETCH_ASSOC);
return $res['cnt']; return $res['cnt'];
} }