修复:诸侯混战宣战,邮件领取,名将谱去除好感,镇念塔层级下降,求贤若渴碎片,pvp,秘境首通
This commit is contained in:
@@ -104,12 +104,10 @@ export default class ServerMail extends MailTemp {
|
||||
}
|
||||
|
||||
|
||||
public static async updateStatusWithCondition(_id: string, roleId: string, status: number, conditions: number[], servermail?: ServerMailType) {
|
||||
public static async updateStatusWithCondition(_id: string, roleId: string, status: number, servermail?: ServerMailType) {
|
||||
if(!servermail) servermail = await ServerMailModel.findById(_id).lean();
|
||||
let { roleStatus } = servermail;
|
||||
let hasRole = roleStatus.find(cur => cur.roleId == roleId);
|
||||
let myStatus = hasRole?hasRole.status: MAIL_STATUS.CREATE;
|
||||
if(conditions.indexOf(myStatus) == -1) return null;
|
||||
if(hasRole) {
|
||||
servermail = await ServerMailModel.findOneAndUpdate({ _id, 'roleStatus.roleId': roleId }, { $set: { 'roleStatus.$.status': status } }, {new: true}).lean();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user