fixed mysql null reference in trending query
This commit is contained in:
parent
e3aa9db329
commit
5ea7d959b9
1 changed files with 1 additions and 1 deletions
|
@ -147,7 +147,7 @@ module.exports = {
|
||||||
const deferred = new Promise((resolve, reject) => {
|
const deferred = new Promise((resolve, reject) => {
|
||||||
// get the raw requests data
|
// get the raw requests data
|
||||||
db.sequelize
|
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 => {
|
.then(results => {
|
||||||
resolve(results);
|
resolve(results);
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue