1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

hifini 添加 order limit 参数

This commit is contained in:
2022-10-29 14:40:58 +08:00
parent 71eb3b7ce5
commit b93e1598e6
4 changed files with 22 additions and 3 deletions

View File

@@ -20,11 +20,23 @@ module.exports = {
},
getIdsToFetch: async () => {
return await dbUtils.query(`SELECT thread_id FROM hifini_thread where music_title='' and music_pic='' and music_url=''`);
let sql = `
SELECT thread_id FROM hifini_thread WHERE music_title='' and music_pic='' and music_url=''
${global.args?.order ? `ORDER BY thread_id ${global.args.order}` : ""}
${global.args?.limit ? `LIMIT ${global.args.limit}` : ""}
`;
console.log(sql);
return await dbUtils.query(sql);
},
getIdsToFetchRealUrl: async () => {
return await dbUtils.query(`SELECT thread_id,music_url FROM hifini_thread where music_url like 'get_music.php?key=%' and music_real_url=''`);
let sql = `
SELECT thread_id,music_url FROM hifini_thread WHERE music_url like 'get_music.php?key=%' and music_real_url=''
${global.args?.order ? `ORDER BY thread_id ${global.args.order}` : ""}
${global.args?.limit ? `LIMIT ${global.args.limit}` : ""}
`;
console.log(sql);
return await dbUtils.query(sql);
}
},