活动:目标点数兑换奖励过期判断

This commit is contained in:
qiaoxin
2021-05-07 19:39:43 +08:00
parent 43345c213b
commit f32e6e312f
5 changed files with 131 additions and 18 deletions

View File

@@ -15,7 +15,24 @@ export default class ActivityThirtyDaysPointReward extends BaseModel {
cellIndex: number; // 第几个奖励
@prop({ required: true })
isReceive: boolean; // 是否领取过奖励
@prop({ required: true })
isExpired: boolean; // 是否过期奖励
//添加过期记录
public static async setExpired(acvitityId: number, roleId: string, cells: Array<number>) {
let records = [];
for (let cellIndex of cells) {
let data = {
acvitityId,
roleId,
cellIndex,
isReceive: false,
isExpired: true,
}
records.push(data)
}
await ActivityThirtyDaysPointRewardModel.insertMany(records);
}
//添加领取记录
public static async addRecord(acvitityId: number, roleId: string, cellIndex: number, lean = true) {