🐞 fix(后台): 修复后台活动积分&大区配置bug
This commit is contained in:
@@ -89,8 +89,8 @@ export default class ActivityController extends Controller {
|
|||||||
|
|
||||||
public async updateActivityTaskPoint() {
|
public async updateActivityTaskPoint() {
|
||||||
const { ctx } = this;
|
const { ctx } = this;
|
||||||
const { taskType, taskId, activityId, point } = ctx.request.body;
|
const { type, taskId, activityId, point, taskType, activityType } = ctx.request.body;
|
||||||
ctx.body = await ctx.service.activity.updateActivityTaskPoint(taskType, taskId, activityId, point);
|
ctx.body = await ctx.service.activity.updateActivityTaskPoint(type, taskId, activityId, activityType, taskType, point);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -177,9 +177,9 @@ export default class Activity extends Service {
|
|||||||
return ctx.service.utils.resResult(STATUS.SUCCESS);
|
return ctx.service.utils.resResult(STATUS.SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async updateActivityTaskPoint(taskType: number, taskId: number, activityId: number, point: number) {
|
public async updateActivityTaskPoint(type: number, taskId: number, activityId: number, activityType: number, taskType: number, point: number) {
|
||||||
const { ctx } = this;
|
const { ctx } = this;
|
||||||
let result = await ActivityTaskPointModel.updateData(taskType, taskId, activityId, point, ctx.user?.uid);
|
let result = await ActivityTaskPointModel.updateData(type, taskId, activityId, activityType, taskType, point, ctx.user?.uid);
|
||||||
if(!result) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
if(!result) return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
|
||||||
return ctx.service.utils.resResult(STATUS.SUCCESS);
|
return ctx.service.utils.resResult(STATUS.SUCCESS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ export default class Activity_Task_Point extends BaseModel {
|
|||||||
point: number; // 增加点数
|
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(
|
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);
|
).lean(true);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,8 +80,16 @@ export default class ServerStategy {
|
|||||||
this.timers = stategy.timers;
|
this.timers = stategy.timers;
|
||||||
this.activityGroupId = stategy.activityGroupId;
|
this.activityGroupId = stategy.activityGroupId;
|
||||||
this.stopRegisterTime = stategy.stopRegisterTime;
|
this.stopRegisterTime = stategy.stopRegisterTime;
|
||||||
if(stategy.hasCircleMail) this.circleMail = stategy.circleMail;
|
if(stategy.hasCircleMail) {
|
||||||
if(stategy.hasOpenMail) this.openMail = stategy.openMail;
|
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> { };
|
export interface ServerStategyType extends Pick<DocumentType<ServerStategy>, keyof ServerStategy> { };
|
||||||
|
|||||||
Reference in New Issue
Block a user