许愿池bug
This commit is contained in:
@@ -123,7 +123,7 @@ export class WishPoolHandler {
|
||||
let sid = await getRedis(key);
|
||||
let goods = await addItems(wishRoleId, role.roleName , sid , [{ id : wishGood.goodId, count: 1 }]);
|
||||
if (!!sid) {
|
||||
this.app.channelService.pushMessageByUids('onWishGoodsRecive', resResult(STATUS.SUCCESS, { goods }), [{uid:wishRoleId, sid}]);
|
||||
this.app.channelService.pushMessageByUids('onWishGoodsRecive', resResult(STATUS.SUCCESS, { wishGoods: resWishGoods }), [{uid:wishRoleId, sid}]);
|
||||
}
|
||||
await WishPoolReportModel.addReport(code, wishRoleId, role.roleName , dntRoleId, dntRoleName, wishGood.goodId, 1);
|
||||
return resResult(STATUS.SUCCESS, { wishDntCnt, updateWishGoods: resWishGoods.map(({type, goodId, count, receiveCnt, drawCnt, id})=>{
|
||||
@@ -140,16 +140,18 @@ export class WishPoolHandler {
|
||||
let userGuild = await getUserGuildWithRefActive(roleId, 'wishDntCnt wishGoods guildCode');
|
||||
if (!userGuild)
|
||||
return resResult(STATUS.WRONG_PARMS);
|
||||
const { guildCode: code, wishGoods } = userGuild;
|
||||
const { wishGoods } = userGuild;
|
||||
let index = findIndex(wishGoods, { id });
|
||||
if (index == -1)
|
||||
return resResult(STATUS.WRONG_PARMS);
|
||||
let { drawCnt, goodId } = wishGoods[index];
|
||||
if (drawCnt <= 0)
|
||||
return resResult(STATUS.WRONG_PARMS);
|
||||
let goods = await addItems(roleId, roleName, sid, [{ id : goodId, count: drawCnt }]);
|
||||
wishGoods[index].drawCnt = 0;
|
||||
await UserGuildModel.updateInfo(code, { wishGoods }, {});
|
||||
let result = await UserGuildModel.updateInfo(roleId, { wishGoods }, {});
|
||||
if (!result)
|
||||
resResult(STATUS.INTERNAL_ERR);
|
||||
let goods = await addItems(roleId, roleName, sid, [{ id : goodId, count: drawCnt }]);
|
||||
return resResult(STATUS.SUCCESS, { goods, wishGoods });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user