活动:首冲礼包一次性领取所有

This commit is contained in:
qiaoxin
2021-05-24 16:06:56 +08:00
parent 4fd14a2075
commit 5e9bd369cb
4 changed files with 18 additions and 8 deletions

View File

@@ -16,9 +16,9 @@ export default class ActivityFirstGift extends BaseModel {
//添加领取记录
public static async addRecord(activityId: number, roleId: string, index: number) {
public static async addRecord(activityId: number, roleId: string, indexArray: number[]) {
let result: ActivityFirstGiftModelType = await ActivityFirstGiftModel.findOneAndUpdate({ roleId, activityId, },
{ $push: { days: index } }, { upsert: true, new: true }).lean(true);
{ $push: { days: { $each: indexArray } } }, { upsert: true, new: true }).lean(true);
return result;
}