许愿池继承问题
This commit is contained in:
@@ -370,16 +370,23 @@ export async function settleGuildWeekly() {
|
||||
|
||||
|
||||
export async function getWishPool(userGuild: UserGuildType) {
|
||||
const { guildCode: code, wishDntCnt, wishGoods } = userGuild;
|
||||
let { guildCode: code, wishDntCnt, wishGoods, receivedWishPool, refTimeDaily } = userGuild;
|
||||
|
||||
const now = new Date();
|
||||
let isRefDaily = shouldRefresh(refTimeDaily, now);
|
||||
// console.log('####### isRefDaily', isRefDaily, refTimeDaily, now)
|
||||
if (isRefDaily) {
|
||||
wishGoods = []; receivedWishPool = [], wishDntCnt = 0;
|
||||
}
|
||||
|
||||
let userGuilds = await UserGuildModel.getWishPoolGoods(code, ' wishDntCnt wishGoods roleId');
|
||||
let list = [];
|
||||
userGuilds.map(({ wishGoods, roleId }) => {
|
||||
wishGoods.map(({ type, goodId, count, receiveCnt, drawCnt, id }) => {
|
||||
userGuilds.forEach(({ wishGoods, roleId }) => {
|
||||
wishGoods.forEach(({ type, goodId, count, receiveCnt, drawCnt, id }) => {
|
||||
list.push({ type, goodId, count, receiveCnt, drawCnt, id, roleId })
|
||||
});
|
||||
});
|
||||
return { list, wishDntCnt: wishDntCnt || 0, wishGoods };
|
||||
return { list, wishDntCnt: wishDntCnt || 0, wishGoods, receivedWishPool };
|
||||
}
|
||||
|
||||
export function setUserGuildSession(session:FrontendOrBackendSession, myUserGuild: UserGuildType) {
|
||||
|
||||
Reference in New Issue
Block a user