活动:首充增加页签
This commit is contained in:
@@ -12,26 +12,29 @@ export default class Activity_First_Gift extends BaseModel {
|
||||
@prop({ required: true })
|
||||
roleId: string; // 用户Id
|
||||
@prop({ required: true })
|
||||
pageIndex: number; // 活动第几页
|
||||
@prop({ required: true })
|
||||
days: Array<number>; // 领取过的奖励
|
||||
@prop({ required: true })
|
||||
isOver: boolean; // 是否全部领取结束
|
||||
|
||||
//添加领取记录
|
||||
public static async addRecord(activityId: number, roleId: string, indexArray: number[], isOver: boolean) {
|
||||
let result: ActivityFirstGiftModelType = await ActivityFirstGiftModel.findOneAndUpdate({ roleId, activityId, },
|
||||
public static async addRecord(activityId: number, roleId: string, pageIndex: number, indexArray: number[], isOver: boolean) {
|
||||
let result: ActivityFirstGiftModelType = await ActivityFirstGiftModel.findOneAndUpdate({ roleId, activityId, pageIndex },
|
||||
{ $push: { days: { $each: indexArray } }, $set: { isOver: isOver } }, { new: true }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
//可以领取首充礼包,充值时间记录
|
||||
public static async begin(activityId: number, roleId: string) {
|
||||
let result: ActivityFirstGiftModelType = await ActivityFirstGiftModel.findOneAndUpdate({ roleId, activityId },
|
||||
public static async begin(activityId: number, roleId: string, pageIndex: number) {
|
||||
let result: ActivityFirstGiftModelType = await ActivityFirstGiftModel.findOneAndUpdate({ roleId, activityId, pageIndex },
|
||||
{}, { upsert: true, new: true }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static async findData(activityId: number, roleId: string) {
|
||||
let result: ActivityFirstGiftModelType = await ActivityFirstGiftModel.findOne({ roleId, activityId }, {}).lean(true);
|
||||
let result: ActivityFirstGiftModelType[] = await ActivityFirstGiftModel.find({ roleId, activityId }, {}).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user