fix: 未使用的参数
This commit is contained in:
@@ -188,17 +188,17 @@ export default class UserGuild extends BaseModel {
|
||||
return userGuilds;
|
||||
}
|
||||
|
||||
public static async pushAndUpdate(roleId: string, update: UserGuildUpdateParam, pushData:{wishGoods?: WishGood}, select?: string, lean = true) {
|
||||
public static async pushAndUpdate(roleId: string, update: UserGuildUpdateParam, pushData:{wishGoods?: WishGood}, select?: string) {
|
||||
const result: UserGuildType = await UserGuildModel.findOneAndUpdate({ roleId, status: USER_GUILD_STATUS.ON }, { $set: update, $push: pushData }, { new: true }).select(select).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async donateGoods(roleId: string, wishDntCnt: number, select?: string, lean = true) {
|
||||
public static async donateGoods(roleId: string, wishDntCnt: number, select?: string) {
|
||||
const result: UserGuildType = await UserGuildModel.findOneAndUpdate({ roleId, status: USER_GUILD_STATUS.ON }, { $inc: { wishDntCnt } }, { new: true }).select(select).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async donateUpdate(roleId: string, id: string, select?: string, lean = true) {
|
||||
public static async donateUpdate(roleId: string, id: string, select?: string) {
|
||||
const result: UserGuildType = await UserGuildModel.findOneAndUpdate({ roleId, status: USER_GUILD_STATUS.ON, 'wishGoods.id': id }, { $inc: { 'wishGoods.$.receiveCnt': 1, 'wishGoods.$.drawCnt': 1} }, { new: true }).select(select).lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -29,14 +29,14 @@ export default class WishPoolReport extends BaseModel {
|
||||
@prop({ required: true })
|
||||
dntRoleName: string; //捐赠人
|
||||
|
||||
public static async addReport(guildCode: string, wishRoleId: string, wishRoleName: string, dntRoleId: string, dntRoleName: string, goodId: number, count: number, lean = true) {
|
||||
public static async addReport(guildCode: string, wishRoleId: string, wishRoleName: string, dntRoleId: string, dntRoleName: string, goodId: number, count: number) {
|
||||
const doc = new WishPoolReportModel();
|
||||
const report = Object.assign(doc.toJSON(), { guildCode, wishRoleId, wishRoleName, dntRoleId, dntRoleName, goodId, dntTime: nowSeconds(), count });
|
||||
await WishPoolReportModel.create(report);
|
||||
return report;
|
||||
}
|
||||
//获得day天之前的许愿池战报
|
||||
public static async getReportsByTime(guildCode: string, day: number, lean = true) {
|
||||
public static async getReportsByTime(guildCode: string, day: number) {
|
||||
let time = getTodayZeroPoint() - day * 24 * 60;
|
||||
const reports = await WishPoolReportModel.find({ guildCode, dntTime: {$gte: time}}).sort({ dntTime : -1 });
|
||||
return reports;
|
||||
|
||||
Reference in New Issue
Block a user