🐞 fix(gvg): 遗迹编队战力未变动
This commit is contained in:
@@ -101,7 +101,7 @@ export default class GVGVestigeRank extends BaseModel {
|
||||
|
||||
public static async updateCe(roleId: string, hid: number, ce: number) {
|
||||
let today = getZeroPoint();
|
||||
await GVGVestigeRankModel.updateMany({ day: today, hasDefense: true, roleId, 'lineup.hid': hid }, { $set: { 'lineup.$.ce': ce } });
|
||||
await GVGVestigeRankModel.updateMany({ day: today, hasDefense: true, roleId, 'lineup.actorId': hid }, { $set: { 'lineup.$.ce': ce } });
|
||||
}
|
||||
|
||||
public static async changeRank(isSuccess: boolean, vestigeId: number, attackInfo: { roleId: string }, defenseInfo: { isRobot: boolean, roleId: string, oldRank: number }): Promise<{ isChange: boolean, atkData?: GVGVestigeRankType, defData?: GVGVestigeRankType, endTime: number }> {
|
||||
|
||||
@@ -96,6 +96,8 @@ export default class GVGVestigeRec extends BaseModel {
|
||||
if(atkNewRank != undefined && defNewRank != undefined) {
|
||||
update['attackInfo.newRank'] = atkNewRank;
|
||||
update['defenseInfo.newRank'] = defNewRank;
|
||||
update['attackInfo.oldRank'] = isSuccess? defNewRank: atkNewRank;
|
||||
update['defenseInfo.oldRank'] = isSuccess? atkNewRank: defNewRank;
|
||||
}
|
||||
|
||||
const result: GVGVestigeRecType = await GVGVestigeRecModel.findOneAndUpdate({ battleCode }, { $set: update }, { new: true }).lean();
|
||||
|
||||
Reference in New Issue
Block a user