团购:修改字段
This commit is contained in:
@@ -72,7 +72,7 @@ export async function setGroupShopToSetSum(arr: { activityId: number, itemId: nu
|
||||
let item = playerData.findItemById(itemId);
|
||||
let nextDiscount = item.getCurDiscount();
|
||||
// 推送频道
|
||||
await sendMessageToGroupShopWithSuc(PUSH_ROUTE.GROUP_SHOP_UPDATE, { activityId, sum, id: itemId, curDiscount: nextDiscount });
|
||||
await sendMessageToGroupShopWithSuc(PUSH_ROUTE.GROUP_SHOP_UPDATE, { activityId, sum, itemId, curDiscount: nextDiscount });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,14 +90,14 @@ export async function refundGroupShop(isDebug = false) {
|
||||
|
||||
let items = playerData.items||[];
|
||||
for(let item of items) {
|
||||
let playerRecords = await ActivityGroupShopUserRecModel.findByPrice(activityData.activityId, item.id, item.getCurDiscount().price);
|
||||
let playerRecords = await ActivityGroupShopUserRecModel.findByPrice(activityData.activityId, item.itemId, item.getCurDiscount().price);
|
||||
for(let { roleId, records } of playerRecords) {
|
||||
for(let { price, buyCnt } of records) {
|
||||
if(price <= item.getCurDiscount().price) continue;
|
||||
let diff = (price - item.getCurDiscount().price) * buyCnt;
|
||||
|
||||
if(!recs.has(roleId)) recs.set(roleId, []);
|
||||
recs.get(roleId).push({ itemId: item.id, diff });
|
||||
recs.get(roleId).push({ itemId: item.itemId, diff });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user