许愿池继承问题
This commit is contained in:
@@ -49,12 +49,12 @@ export class WishPoolHandler {
|
||||
let userGuild = await refreshUserGuild(myUserGuild, roleId);
|
||||
if (!userGuild) return resResult(STATUS.WRONG_PARMS);
|
||||
|
||||
const { guildCode: code, wishGoods, receivedWishPool, createdAt } = userGuild;
|
||||
const { guildCode: code, wishGoods, receivedWishPool } = userGuild;
|
||||
|
||||
let { lv } = await GuildModel.findGuild(code, serverId, 'lv');
|
||||
let len = wishGoods.filter(cur => cur.type == type).length;
|
||||
|
||||
if(receivedWishPool.indexOf(type) != -1 && getSeconds(createdAt) > getZeroPoint()) {
|
||||
if(receivedWishPool.indexOf(type) != -1) {
|
||||
return resResult(STATUS.HAS_REACH_WISH_COUNT_LIMIT);
|
||||
}
|
||||
if (len >= ARMY.ARMY_WISH_TIMES) //今日已经许愿过
|
||||
@@ -70,7 +70,7 @@ export class WishPoolHandler {
|
||||
|
||||
const id = genCode(6);
|
||||
let { wishGoods: resWishGoods } = await UserGuildModel.pushAndUpdate(roleId, {}, { wishGoods: { type, goodId, count, receiveCnt: 0, drawCnt: 0, id, donateNames:[]} }, 'wishGoods');
|
||||
return resResult(STATUS.SUCCESS, { wishGoods: resWishGoods });
|
||||
return resResult(STATUS.SUCCESS, { wishGoods: resWishGoods, receivedWishPool });
|
||||
}
|
||||
|
||||
// 捐赠
|
||||
@@ -147,7 +147,7 @@ export class WishPoolHandler {
|
||||
if (!result)
|
||||
resResult(STATUS.INTERNAL_ERR);
|
||||
let goods = await addItems(roleId, roleName, sid, [{ id : goodId, count: drawCnt }], ITEM_CHANGE_REASON.WISH_POOL_RECEIVE);
|
||||
return resResult(STATUS.SUCCESS, { goods, wishGoods });
|
||||
return resResult(STATUS.SUCCESS, { goods, wishGoods, receivedWishPool });
|
||||
}
|
||||
|
||||
async getReports(msg: guildInter & {}, session: BackendSession) {
|
||||
|
||||
Reference in New Issue
Block a user