🐞 fix(拍卖行): 修复拍卖行发生的很多问题

This commit is contained in:
luying
2023-06-29 20:39:31 +08:00
parent 4d2853f62f
commit 4c067f87a8
4 changed files with 25 additions and 16 deletions
+3 -3
View File
@@ -569,9 +569,8 @@ export async function getLotStatus(auctionStage: number, max: boolean, maxFlag:
}
export async function extendLotTime(lot: LotType) {
if(lot.status != LOT_STATUS.BIDDING) {
clearLotTimer(lot.code);
} else {
clearLotTimer(lot.code);
if(lot.status == LOT_STATUS.BIDDING) {
let timer = setTimeout(async () => {
await sendSingleLot(lot.code);
}, lot.end.getTime() - Date.now());
@@ -582,6 +581,7 @@ export async function extendLotTime(lot: LotType) {
export async function sendSingleLot(code: string) {
console.log('schedule sendSingleLot called:', new Date());
let lot = await LotModel.setLotSold(code, AUCTION_STAGE.GUILD); // 正在竞拍的拍品
if(!lot) return;
await sendLotsRewardToMlail([lot]);
await pushAuctionOver(lot);
return true;