diff --git a/controllers/statsController.js b/controllers/statsController.js index 540ebc9a..e9593c4b 100644 --- a/controllers/statsController.js +++ b/controllers/statsController.js @@ -147,7 +147,7 @@ module.exports = { const deferred = new Promise((resolve, reject) => { // get the raw requests data db.sequelize - .query('SELECT COUNT(*), File.* FROM Request LEFT JOIN File ON Request.FileId = File.id WHERE FileId != "null" AND nsfw != 1 AND trendingEligible = 1 GROUP BY FileId ORDER BY COUNT(*) DESC LIMIT 25;', { type: db.sequelize.QueryTypes.SELECT }) + .query('SELECT COUNT(*), File.* FROM Request LEFT JOIN File ON Request.FileId = File.id WHERE FileId IS NOT NULL AND nsfw != 1 AND trendingEligible = 1 GROUP BY FileId ORDER BY COUNT(*) DESC LIMIT 25;', { type: db.sequelize.QueryTypes.SELECT }) .then(results => { resolve(results); })