获得试炼奖励
This commit is contained in:
@@ -79,11 +79,10 @@ export class GuildTrainHandler {
|
||||
const { guildCode: code } = userGuild;
|
||||
let guildTrains = await GuildTrainModel.findGuildTrain(code);
|
||||
let resTrainBoxs = [];
|
||||
let { trainId: curTrainId } = await GuildModel.findGuild(code, serverId, 'trainId');
|
||||
guildTrains.forEach(({trainInstances, trainId}) =>{
|
||||
let { trainInstances: instances } = getArmyTrainJuDian(trainId);
|
||||
let flag = false;
|
||||
let boxRewards = []
|
||||
let boxRewards = [];
|
||||
trainInstances.map(({hid, progress, endTime, trainBoxs})=>{
|
||||
let instance = findWhere(instances, { hid });
|
||||
let isComplete = false;
|
||||
@@ -93,11 +92,11 @@ export class GuildTrainHandler {
|
||||
flag = true;
|
||||
boxRewards.push({hid, recordBoxs: trainBoxs, trainId, endTime, isComplete});
|
||||
});
|
||||
if (flag || trainId == curTrainId) {
|
||||
resTrainBoxs.push(...boxRewards);
|
||||
if (flag) {
|
||||
resTrainBoxs.push({ trainId, boxRewards });
|
||||
}
|
||||
})
|
||||
return resResult(STATUS.SUCCESS, {trainBoxs: resTrainBoxs});
|
||||
return resResult(STATUS.SUCCESS, {trainBoxRewards: resTrainBoxs});
|
||||
}
|
||||
|
||||
async trainBattleStart(msg: { hid: number, trainId: number, difficulty: number }, session: BackendSession) {
|
||||
|
||||
Reference in New Issue
Block a user