mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 04:01:35 +00:00
Empty commit
This commit is contained in:
parent
d943ecd296
commit
84f5e7a68e
@ -54,6 +54,9 @@ public static function get_user_votes($UserID) {
|
||||
* @return array (Upvotes, Total Votes)
|
||||
*/
|
||||
public static function get_group_votes($GroupID) {
|
||||
if (!is_number($GroupID)) {
|
||||
return array('Ups' => 0, 'Total' => 0);
|
||||
}
|
||||
$GroupVotes = G::$Cache->get_value("votes_$GroupID");
|
||||
if ($GroupVotes === false) {
|
||||
$QueryID = G::$DB->get_query_id();
|
||||
|
@ -11,11 +11,11 @@
|
||||
SELECT v.GroupID, SUM(IF(v.Type='Up',1,0)) AS Ups, COUNT(1) AS Total
|
||||
FROM ( SELECT UserID
|
||||
FROM users_votes
|
||||
WHERE GroupID = $GroupID
|
||||
WHERE GroupID = '$GroupID'
|
||||
AND Type='Up'
|
||||
) AS a
|
||||
JOIN users_votes AS v USING (UserID)
|
||||
WHERE v.GroupID != $GroupID
|
||||
WHERE v.GroupID != '$GroupID'
|
||||
GROUP BY v.GroupID
|
||||
HAVING Ups > 0");
|
||||
$VotePairs = $DB->to_array('GroupID', MYSQL_ASSOC, false);
|
||||
|
Loading…
Reference in New Issue
Block a user