Merge branch 'f0ckdev' into 'master'

need coffee plox

See merge request !99
This commit is contained in:
Flummi 2017-03-22 02:02:04 +00:00
commit 72df37f103

View File

@ -22,8 +22,8 @@ module.exports = (lib) => {
let vars = params.in.concat(params.not);
params.in = new Array(params.in.length).fill('username LIKE ?');
params.out = params.in.length > 0 ? [] : new Array(params.out.length).fill('username NOT LIKE ?');
let where = params.in.concat(params.out);
params.not = params.in.length > 0 ? [] : new Array(params.not.length).fill('username NOT LIKE ?');
let where = params.in.concat(params.not);
let query = `SELECT id, username FROM f0ck.items ${where.length > 0 ? `WHERE ${where.join(' || ')}` : ''} ORDER BY rand() LIMIT 1`;
console.log( query );