This commit is contained in:
mamengke01
2021-02-07 16:26:31 +08:00
parent ad1881ff9d
commit 63cd693935
6 changed files with 22 additions and 16 deletions
+3
View File
@@ -179,6 +179,9 @@ export const STATUS = {
GUILD_TRAIN_IS_NOT_COMPLETE: { code: 20968, simStr: '军团该训练场没有完成' },
GUILD_TRAIN_QUALITY_REWARD_IS_GOT: { code: 20969, simStr: '军团训练进阶奖励已经领取' },
GUILD_PERSITION_TREE_NOT_LIGHT: { code: 20970, simStr: '军团前置科技树未研发' },
GUILD_TRAIN_BOX_IS_OVER_TIME: { code: 20971, simStr: '军团宝箱超时' },
GUILD_TRAIN_BOX_INDEX_IS_GOT:{ code: 20972, simStr: '该位置试炼宝箱已经领取过,请重新选择' },
GUILD_TRAIN_BOX_IS_GOT: { code: 20973, simStr: '玩家已经领取该试炼宝箱' },
// 通用 30000 - 30099
DIC_DATA_NOT_FOUND: { code: 30000, simStr: '数据表未找到' },
ROLE_MATERIAL_NOT_ENOUGH: { code: 30001, simStr: '材料数量不足' },
+1 -1
View File
@@ -82,7 +82,7 @@ export default class GroupMail extends BaseModel {
}
public static async findReadAndRewardsMails(roleId: string, lean = true) {
const ids: string[] = await GroupMailModel.find({ 'sendRoles.roleId': roleId, sendTime:{$lte: nowSeconds()}, $or:[ {$and: [{'sendRoles.status': MAIL_STATUS.READ, goods: []}]}, {'sendRoles.status': MAIL_STATUS.RECEIVED}] }).select('_id').lean(lean);
const ids: GroupMailType[] = await GroupMailModel.find({ 'sendRoles.roleId': roleId, sendTime:{$lte: nowSeconds()}, $or:[ {$and: [{'sendRoles.status': MAIL_STATUS.READ, goods: []}]}, {'sendRoles.status': MAIL_STATUS.RECEIVED}] }).select('_id').lean(lean);
return ids;
}
+3 -4
View File
@@ -73,7 +73,7 @@ export default class GuildTrain extends BaseModel {
public static async updateGuildTrainProgress(guildCode: string, trainId: number, hid:number, progress: number, ranks:Array<Rank>, isComplete: boolean,lean = true) {
const guildTrain: GuildTrainType = await GuildTrainModel.findOneAndUpdate({ guildCode, trainId, 'trainInstances.hid':hid},
{ $set: {'trainInstances.$.progress': progress, ranks, isComplete,'trainInstances.$.endTime': nowSeconds() + 24*60*60} },{new: true}).lean(lean);
{ $set: {'trainInstances.$.progress': progress, ranks, isComplete,'trainInstances.$.endTime': (nowSeconds() + 24 * 60 * 60)} },{new: true}).lean(lean);
return guildTrain;
}
@@ -83,9 +83,8 @@ export default class GuildTrain extends BaseModel {
return guildTrain;
}
public static async findTrainInstanceBoxByIndex(guildCode: string, roleId: string, trainId: number, hid: number, index: number, progress: number, time: number, locked = false, lean = true) {
const guildTrain: GuildTrainType = await GuildTrainModel.findOne({ guildCode, trainId, locked, 'trainInstances.hid': hid,
'trainInstances.trainBoxs.index':{$ne:index },'trainInstances.trainBoxs.roleId':{$ne:roleId }, 'trainInstances.progress': {$gte: progress}, 'trainInstances.endTime':{$gte: time}}).lean(lean);
public static async findTrainInstanceBoxByIndex(guildCode: string, trainId: number, hid: number, progress: number, locked = false, lean = true) {
const guildTrain: GuildTrainType = await GuildTrainModel.findOne({ guildCode, trainId, locked, 'trainInstances.hid': hid, 'trainInstances.progress': {$gte: progress} }).lean(lean);
return guildTrain;
}
+1 -1
View File
@@ -77,7 +77,7 @@ export default class Mail extends BaseModel {
}
public static async findReadAndRewardsMails(roleId: string, lean = true) {
const ids: string[] = await MailModel.find({ roleId, $or: [{ $and: [{ status: MAIL_STATUS.READ, goods: [] }] }, { status: MAIL_STATUS.RECEIVED }], sendTime:{$lte: nowSeconds()} }).select('_id').lean(lean);
const ids: MailType[] = await MailModel.find({ roleId, $or: [{ $and: [{ status: MAIL_STATUS.READ, goods: [] }] }, { status: MAIL_STATUS.RECEIVED }], sendTime:{$lte: nowSeconds()} }).select('_id').lean(lean);
return ids;
}