mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
修复题目列表分页异常
This commit is contained in:
1 parent
9e5d3dea89
commit
cbcf9ebbc2
5 files changed
+118
-35
No files matched your search
@@ -34,7 +34,7 @@ class ProblemHandler extends Handler {
|
||||
let psdict = {};
|
||||
if (category) q.category = category;
|
||||
if (!this.user.hasPerm(PERM_VIEW_PROBLEM_HIDDEN)) q.hidden = false;
|
||||
const [pdocs, pcount] = await paginate(
|
||||
const [pdocs, ppcount, pcount] = await paginate(
|
||||
problem.getMulti(q).sort({ pid: 1 }),
|
||||
page,
|
||||
await system.get('PROBLEM_PER_PAGE'),
|
||||
@@ -47,7 +47,7 @@ class ProblemHandler extends Handler {
|
||||
['problem_main', null],
|
||||
];
|
||||
this.response.body = {
|
||||
path, page, pcount, pdocs, psdict, category,
|
||||
path, page, pcount, ppcount, pdocs, psdict, category,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
const { ObjectID } = require('bson');
|
||||
|
||||
exports.udoc = {
|
||||
_id: 0,
|
||||
mail: '',
|
||||
@@ -44,7 +46,7 @@ export interface TestCase {
|
||||
export interface Rdoc {
|
||||
_id: ObjectID,
|
||||
pid: ObjectID,
|
||||
owner: number,
|
||||
uid: number,
|
||||
lang: string,
|
||||
code: string,
|
||||
score: number,
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ export interface TestCase {
|
||||
export interface Rdoc {
|
||||
_id: ObjectID,
|
||||
pid: ObjectID,
|
||||
owner: number,
|
||||
uid: number,
|
||||
lang: string,
|
||||
code: string,
|
||||
score: number,
|
||||
|
||||
Reference in new issue
Block a user