🐞 fix(后台): 修复后台活动积分&大区配置bug

This commit is contained in:
luying
2022-11-01 13:48:14 +08:00
parent eb6f9603cb
commit 4259a0e9a4
4 changed files with 16 additions and 8 deletions
+2 -2
View File
@@ -25,9 +25,9 @@ export default class Activity_Task_Point extends BaseModel {
point: number; // 增加点数
//更新活动数据
public static async updateData(type: number, taskId: number, activityId: number, point: number, uid = 1) {
public static async updateData(type: number, taskId: number, activityId: number, activityType: number, taskType: number, point: number, uid = 1) {
let result: ActivityTaskPointModelType = await ActivityTaskPointModel.findOneAndUpdate(
{ type, taskId, activityId }, { $set: { point, updatedBy: uid }, $setOnInsert: { createdBy: uid } }, { upsert: true, new: true }
{ type, taskId, activityId }, { $set: { activityType, taskType, point, updatedBy: uid }, $setOnInsert: { createdBy: uid } }, { upsert: true, new: true }
).lean(true);
return result;
}
+10 -2
View File
@@ -80,8 +80,16 @@ export default class ServerStategy {
this.timers = stategy.timers;
this.activityGroupId = stategy.activityGroupId;
this.stopRegisterTime = stategy.stopRegisterTime;
if(stategy.hasCircleMail) this.circleMail = stategy.circleMail;
if(stategy.hasOpenMail) this.openMail = stategy.openMail;
if(stategy.hasCircleMail) {
this.circleMail = stategy.circleMail;
} else {
this.circleMail = null;
}
if(stategy.hasOpenMail) {
this.openMail = stategy.openMail;
} else {
this.openMail = null;
}
}
}
export interface ServerStategyType extends Pick<DocumentType<ServerStategy>, keyof ServerStategy> { };