✨ feat(活动): 微信公众号口令
This commit is contained in:
@@ -16,6 +16,9 @@ class RoleRecord {
|
||||
@prop({ required: true, default: 0 })
|
||||
serverId: number;
|
||||
|
||||
@prop({ required: false, default: '' })
|
||||
orderId?: string;
|
||||
|
||||
@prop({ required: true, default: 0 })
|
||||
time: number;
|
||||
}
|
||||
@@ -70,9 +73,9 @@ export default class GiftCodeDetail extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async increaseUsedNum(code: string, roleId: string, roleName: string, serverId: number) {
|
||||
public static async increaseUsedNum(code: string, roleId: string, roleName: string, serverId: number, orderId?: string) {
|
||||
let result: GiftCodeDetailType = await GiftCodeDetailModel.findOneAndUpdate({ code }, {
|
||||
$inc: { usedNum: 1 }, $push: { roleIds: roleId, record: { roleId, roleName, serverId, time: nowSeconds() } }
|
||||
$inc: { usedNum: 1 }, $push: { roleIds: roleId, record: { roleId, roleName, serverId, time: nowSeconds(), orderId } }
|
||||
}, { new: true }).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user