✨ feat(活动): 节日活动高级签到邮件补发
This commit is contained in:
@@ -27,6 +27,8 @@ export default class Activity_Sign_In extends BaseModel {
|
||||
roundIndex: number; // 周期数,从活动设置的开始时间计算
|
||||
@prop({ required: true, type: Activity_Sign_In_Record, _id: false })
|
||||
records: Activity_Sign_In_Record[]; // 领取记录
|
||||
@prop({ required: false })
|
||||
hasRepair: boolean; // 是否补发了
|
||||
|
||||
//签到记录
|
||||
public static async addSignInRecord(activityId: number, roleId: string, roundIndex: number, dayIndex: number) {
|
||||
@@ -48,6 +50,16 @@ export default class Activity_Sign_In extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
// 根据活动id查询记录
|
||||
public static async findByActivity(activityId: number, roundIndex: number) {
|
||||
let result: ActivitySignInModelType[] = await ActivitySignInModel.find({ activityId, roundIndex }).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async repairSignIn(activityId: number, roleIds: string[]) {
|
||||
await ActivitySignInModel.updateMany({ activityId, roleId: { $in: roleIds } }, { $set: { hasRepair: true } });
|
||||
}
|
||||
|
||||
//删除签到记录
|
||||
public static async deleteActivity(activityId: number, roleId: string, roundIndex: number) {
|
||||
await ActivitySignInModel.deleteMany({ roleId, activityId, roundIndex });
|
||||
|
||||
Reference in New Issue
Block a user