🐞 fix(活动): 修复活动商店记录bug
This commit is contained in:
@@ -45,9 +45,13 @@ export default class Activity_Refresh_Shop extends BaseModel {
|
||||
goods: GoodsInfo[]; // 可购买商品
|
||||
|
||||
//购买领取奖励的记录
|
||||
public static async addRecord(activityId: number, roleId: string, roundIndex: number, pageIndex: number, id: number) {
|
||||
public static async addRecord(activityId: number, roleId: string, roundIndex: number, pageIndex: number, id: number, count: number) {
|
||||
let records = [];
|
||||
for(let i = 0; i < count; i++) {
|
||||
records.push({ id, pageIndex, time: new Date() });
|
||||
}
|
||||
let result: ActivityRefreshShopModelType = await ActivityRefreshShopModel.findOneAndUpdate({ roleId, activityId, roundIndex },
|
||||
{ $push: { records: { pageIndex, id, time: new Date() } } }, { upsert: true, new: true }).lean(true);
|
||||
{ $push: { records: { $each: records } } }, { upsert: true, new: true }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user