From 89b2443ae3cdb50c7bf1c0d7cb82e7b717687bb4 Mon Sep 17 00:00:00 2001 From: t123yh Date: Sat, 26 Aug 2017 21:28:50 +0800 Subject: [PATCH] Rewrite judge filter logic. --- modules/admin.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/admin.js b/modules/admin.js index bc0e1ba..2de0d5d 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -240,12 +240,14 @@ app.post('/admin/rejudge', async (req, res) => { let maxScore = parseInt(req.body.max_score); if (isNaN(maxScore)) maxScore = 100; - where.score = { - $and: { - $gte: parseInt(minScore), - $lte: parseInt(maxScore) - } - }; + if (!(minScore === 0 && maxScore === 100)) { + where.score = { + $and: { + $gte: parseInt(minScore), + $lte: parseInt(maxScore) + } + }; + } let minTime = syzoj.utils.parseDate(req.body.min_time); if (isNaN(minTime)) minTime = 0;