🐞 fix(拍卖行): 按照小区保留拍品数量

This commit is contained in:
luying
2023-05-12 15:31:30 +08:00
parent 5a83742592
commit 133d85c303
2 changed files with 2 additions and 2 deletions
@@ -114,7 +114,7 @@ export class AuctionHandler {
} }
bidRoles.push({ roleId, price: newPrice, time: new Date() }); bidRoles.push({ roleId, price: newPrice, time: new Date() });
const newLot = await LotModel.updateLot({ code, curBuyer: roleId, curPrice: newPrice, auctionStage, prePrice: curPrice, bidRoles, status: max ? LOT_STATUS.MAX : (maxFlag ? LOT_STATUS.SOLD : LOT_STATUS.ING), watchingRoles: Array.from(new Set([...watchingRoles, roleId])), seq: 0 }); const newLot = await LotModel.updateLot({ code, curBuyer: roleId, curPrice: newPrice, auctionStage, prePrice: curPrice, bidRoles, status: max ? LOT_STATUS.MAX : (maxFlag ? LOT_STATUS.SOLD : LOT_STATUS.ING), watchingRoles: Array.from(new Set([...watchingRoles, roleId])), seq: 0 });
if(seq <= LOTS_KEEP_TO_WORLD_CNT && seq > 0) await LotModel.setSeq(begin, gid, count, seq); if(seq <= LOTS_KEEP_TO_WORLD_CNT && seq > 0) await LotModel.updateOne({ begin, gid, count, status: LOT_STATUS.DEFAULT, serverId, seq: { $gt: LOTS_KEEP_TO_WORLD_CNT } }, { $set: { seq }});
await pushAuctionOver(newLot); // 推送竞价超过标志 await pushAuctionOver(newLot); // 推送竞价超过标志
res.releaseCallback(); res.releaseCallback();
+1 -1
View File
@@ -192,7 +192,7 @@ export async function genAuction(guildCode: string, sourceType: number, sourceCo
const guildEnd = await guildAuctionEnd(); const guildEnd = await guildAuctionEnd();
const lotsData: LotParam[] = []; const lotsData: LotParam[] = [];
for(let [id, items] of rewards) { for(let [id, items] of rewards) {
let seq = await CounterLotsModel.getNewCounter(id, begin, items.length); let seq = await CounterLotsModel.getNewCounter(id * 100000 + serverId, begin, items.length);
for(let i = 0; i < items.length; i++) { for(let i = 0; i < items.length; i++) {
let { goods: {id, count}, maxPrice, basePrice, sort } = items[i]; let { goods: {id, count}, maxPrice, basePrice, sort } = items[i];
let code = genCode(LOT_CODE_LEN); let code = genCode(LOT_CODE_LEN);