feat(dataLogs): show user score change history

This commit is contained in:
OldHawk
2018-06-06 00:48:30 +08:00
parent 060a70c96c
commit e1d4537164
24 changed files with 430 additions and 50 deletions

View File

@@ -732,9 +732,17 @@ exports.thumbsUp = function (req, res) {
} else {
if (req.user.score >= thumb.score) {
r._thumbs.push(thumb);
scoreUpdate(req, r.user, scoreConfig.action.thumbsUpScoreOfTopicTo);
save();
//score update
//score update
var act = scoreConfig.action.thumbsUpScoreOfTopicTo;
act.params = {
fid: topic.forum,
tid: topic._id
};
scoreUpdate(req, r.user, act);
//add server message
if (serverNoticeConfig.action.forumReplyThumbsUp.enable) {
serverMessage.addMessage(replyUid, serverNoticeConfig.action.forumReplyThumbsUp.title, serverNoticeConfig.action.forumReplyThumbsUp.content, {
@@ -769,9 +777,16 @@ exports.thumbsUp = function (req, res) {
} else {
if (req.user.score >= thumb.score) {
topic._thumbs.push(thumb);
scoreUpdate(req, topic.user, scoreConfig.action.thumbsUpScoreOfTopicTo);
save();
//score update
var act = scoreConfig.action.thumbsUpScoreOfTopicTo;
act.params = {
fid: topic.forum,
tid: topic._id
};
scoreUpdate(req, topic.user, act);
//add server message
if (serverNoticeConfig.action.forumTopicThumbsUp.enable) {
serverMessage.addMessage(topic.user._id, serverNoticeConfig.action.forumTopicThumbsUp.title, serverNoticeConfig.action.forumTopicThumbsUp.content, {
@@ -801,7 +816,13 @@ exports.thumbsUp = function (req, res) {
}
});
scoreUpdate(req, user, scoreConfig.action.thumbsUpScoreOfTopicFrom);
//score update
var act = scoreConfig.action.thumbsUpScoreOfTopicFrom;
act.params = {
fid: topic.forum,
tid: topic._id
};
scoreUpdate(req, user, act);
}
};