Browse Source

Fix bug of counting AC and submit

pull/6/head
Menci 8 years ago
parent
commit
db525fd7c8
  1. 15
      models/user.js

15
models/user.js

@ -91,7 +91,10 @@ class User extends Model {
attributes: ['problem_id'], attributes: ['problem_id'],
where: { where: {
user_id: this.id, user_id: this.id,
status: 'Accepted' status: 'Accepted',
type: {
$ne: 1 // Not a contest submissio
}
} }
}); });
@ -100,7 +103,10 @@ class User extends Model {
this.ac_num = s.size; this.ac_num = s.size;
let cnt = await JudgeState.count({ let cnt = await JudgeState.count({
user_id: this.id user_id: this.id,
type: {
$ne: 1 // Not a contest submissio
}
}); });
this.submit_num = cnt; this.submit_num = cnt;
@ -113,7 +119,10 @@ class User extends Model {
attributes: ['problem_id'], attributes: ['problem_id'],
where: { where: {
user_id: this.id, user_id: this.id,
status: 'Accepted' status: 'Accepted',
type: {
$ne: 1 // Not a contest submissio
}
} }
}); });

Loading…
Cancel
Save