mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Comments/rating
* do not include the +1 every comment starts with in the distribution and preview
This commit is contained in:
@@ -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]);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user