Browse Source

Merge pull request #92 from BalanceUhen/patch-1

Fix #91
pull/6/head
Menci 6 years ago committed by GitHub
parent
commit
63fed4e7b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      models/rating_calculation.js

2
models/rating_calculation.js

@ -39,7 +39,7 @@ class RatingCalculation extends Model {
await history.destroy(); await history.destroy();
const ratingItem = (await RatingHistory.findOne({ const ratingItem = (await RatingHistory.findOne({
where: { user_id: user.id }, where: { user_id: user.id },
order: 'rating_calculation_id DESC' order: [['rating_calculation_id','DESC']]
})); }));
user.rating = ratingItem ? ratingItem.rating_after : syzoj.config.default.user.rating; user.rating = ratingItem ? ratingItem.rating_after : syzoj.config.default.user.rating;
await user.save(); await user.save();

Loading…
Cancel
Save