🐞 fix(巅峰演武): 修复刷新对手信息错误
This commit is contained in:
@@ -188,7 +188,7 @@ export class PvpHandler {
|
|||||||
await checkTask(serverId, roleId, sid, TASK_TYPE.PVP);
|
await checkTask(serverId, roleId, sid, TASK_TYPE.PVP);
|
||||||
|
|
||||||
// 对手记录更新
|
// 对手记录更新
|
||||||
await PvpHistoryOppModel.setStatus(roleId, oppRoleId, 1);
|
await PvpHistoryOppModel.setStatus(curOpp.oppDef.toString(), 1);
|
||||||
|
|
||||||
let update: pvpUpdateInter = {
|
let update: pvpUpdateInter = {
|
||||||
oppBeforePlayers: pvpDefense.oppPlayers
|
oppBeforePlayers: pvpDefense.oppPlayers
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ export default class PvpHistoryOpp extends BaseModel {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async setStatus(roleId: string, oppRoleId: string, status: number) {
|
public static async setStatus(_id: string, status: number) {
|
||||||
const result: PvpHistoryOppType = await PvpHistoryOppModel.findOneAndUpdate({ roleId, oppRoleId }, {status}, {new: true}).lean();
|
const result: PvpHistoryOppType = await PvpHistoryOppModel.findByIdAndUpdate(_id, { $set: {status}}, {new: true}).lean();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user