core: buildContent: sv for samples
core&ui: record_main: filter_by_status
ui: scoreboard: colorize
This commit is contained in:
undefined committed 2021-05-05 21:10:17 +08:00
1 parent b0cf638616
commit 7d7d3c1599
14 files changed
+69 -38

No files matched your search

+3 -1
View File
@@ -19,8 +19,9 @@ class RecordListHandler extends Handler {
@param('pid', Types.Name, true)
@param('tid', Types.ObjectID, true)
@param('uidOrName', Types.Name, true)
@param('status', Types.Int, true)
@param('allDomain', Types.Boolean, true)
async get(domainId: string, page = 1, pid?: string, tid?: ObjectID, uidOrName?: string, all = false) {
async get(domainId: string, page = 1, pid?: string, tid?: ObjectID, uidOrName?: string, status?: number, all = false) {
this.response.template = 'record_main.html';
const q: FilterQuery<Rdoc> = { 'contest.tid': tid, hidden: false };
if (tid) {
@@ -42,6 +43,7 @@ class RecordListHandler extends Handler {
if (pdoc) q.pid = pdoc.docId;
else q.pid = null;
}
if (status) q.status = status;
const [rdocs] = await paginate(
record.getMulti(domainId, q).sort('_id', -1),
page,