活动:寻宝骑兵-每日物资
This commit is contained in:
@@ -10,14 +10,21 @@ import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoos
|
||||
@index({ roleId: 1 })
|
||||
|
||||
export default class Activity_Treasure_Hunt_Shop extends ActivityShop {
|
||||
@prop({ required: true })
|
||||
dayIndex: number; // 第几天
|
||||
@prop({ required: true })
|
||||
dayIndex: number; // 第几天
|
||||
|
||||
//根据活动id查询活动数据
|
||||
public static async findTreasureData(serverId: number, activityId: number, roleId: string, roundIndex: number, dayIndex: number) {
|
||||
let result: ActivityTreasureHuntShopModelType = await ActivityTreasureHuntShopModel.findOne({ roleId, activityId, roundIndex, dayIndex }).lean(true);
|
||||
return result;
|
||||
}
|
||||
//根据活动id查询活动数据
|
||||
public static async findTreasureData(serverId: number, activityId: number, roleId: string, roundIndex: number, dayIndex: number) {
|
||||
let result: ActivityTreasureHuntShopModelType = await ActivityTreasureHuntShopModel.findOne({ roleId, activityId, roundIndex, dayIndex }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
//购买领取奖励的记录
|
||||
public static async buyShopRecord(activityId: number, roleId: string, roundIndex: number, dayIndex: number, id: number) {
|
||||
let result: ActivityTreasureHuntShopModelType = await ActivityTreasureHuntShopModel.findOneAndUpdate({ roleId, activityId, roundIndex, dayIndex },
|
||||
{ $push: { records: { id, time: new Date() } } }, { upsert: true, new: true }).lean(true);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
export const ActivityTreasureHuntShopModel = getModelForClass(Activity_Treasure_Hunt_Shop);
|
||||
|
||||
Reference in New Issue
Block a user