Skip to content

Commit 3c46d6f

Browse files
authored
Merge pull request #61 from Human-Connection/55-endpoint-for-country-ranking
Adjust sql statement so only active entries will be counted for the c…
2 parents a403727 + 18d2f5c commit 3c46d6f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ exports.getCountries = function(callback){
132132
pool.getConnection(function(err, connection) {
133133
if(err) { console.log(err); callback(true); return; }
134134

135-
let sql = "SELECT country, COUNT(id) AS number FROM entries WHERE country != '' GROUP BY country ORDER BY number DESC;";
135+
let sql = "SELECT country, COUNT(id) AS number FROM entries WHERE email_confirmed > 0 AND status < 2 AND country != '' GROUP BY country ORDER BY number DESC;";
136136

137137
connection.query(sql, function(err, results) {
138138
connection.release();

0 commit comments

Comments
 (0)