Comments/rating

* do not include the +1 every comment starts with in the distribution and preview
This commit is contained in:
Sarjuuk
2016-02-06 21:18:02 +01:00
parent 447f7f02a7
commit fe7f05c89c
2 changed files with 2 additions and 2 deletions

View File

@@ -182,7 +182,7 @@ class AjaxComment extends AjaxHandler
if (!$this->_get['id'])
return Util::toJSON(['success' => 0]);
if ($votes = DB::Aowow()->selectRow('SELECT 1 AS success, SUM(IF(value > 0, value, 0)) AS up, SUM(IF(value < 0, -value, 0)) AS down FROM ?_comments_rates WHERE commentId = ?d GROUP BY commentId', $this->_get['id']))
if ($votes = DB::Aowow()->selectRow('SELECT 1 AS success, SUM(IF(value > 0, value, 0)) AS up, SUM(IF(value < 0, -value, 0)) AS down FROM ?_comments_rates WHERE commentId = ?d and userId <> 0 GROUP BY commentId', $this->_get['id']))
return Util::toJSON($votes);
else
return Util::toJSON(['success' => 1, 'up' => 0, 'down' => 0]);

View File

@@ -71,7 +71,7 @@ class CommunityContent
JOIN
?_account a ON c.userId = a.id
LEFT JOIN
?_comments_rates cr ON cr.commentId = c.id
?_comments_rates cr ON cr.commentId = c.id AND cr.userId <> 0
LEFT JOIN
?_comments c2 ON c.replyTo = c2.id
WHERE