Browse Source

Fix error.

pull/6/head
t123yh 7 years ago
parent
commit
abdfa630b4
  1. 3
      modules/problem.js

3
modules/problem.js

@ -128,10 +128,9 @@ app.get('/problems/search', async (req, res) => {
if (sort === 'ac_rate') {
sortVal = { raw: 'ac_num / submit_num' };
}
let order = [syzoj.db.literal('`id` = ' + id + ' DESC'), [sortVal, order]];
let paginate = syzoj.utils.paginate(await Problem.count(where), req.query.page, syzoj.config.page.problem);
let problems = await Problem.query(paginate, where, order);
let problems = await Problem.query(paginate, where, [syzoj.db.literal('`id` = ' + id + ' DESC'), [sortVal, order]]);
await problems.forEachAsync(async problem => {
problem.allowedEdit = await problem.isAllowedEditBy(res.locals.user);

Loading…
Cancel
Save