拍卖行:修复世界拍卖的时候整理格式报错

This commit is contained in:
luying
2022-06-02 20:55:05 +08:00
parent 2157e1c105
commit a05fd1e1c0
2 changed files with 3 additions and 1 deletions

View File

@@ -121,9 +121,9 @@ export class AuctionHandler {
if (auctionStage === AUCTION_STAGE.GUILD) {
const dividend = await DividendModel.updateLot(code, gid, curPrice, incPrice, max);
newDividend = await calculateDividend(dividend);
await sendMessageToGuildWithSuc(guildCode, PUSH_ROUTE.DIVIDEND_UPDATE, { dividends: processDividendFormat([newDividend]) })
}
let newLotResult = processSingleLotFormat(newLot);
await sendMessageToGuildWithSuc(guildCode, PUSH_ROUTE.DIVIDEND_UPDATE, { dividends: processDividendFormat([newDividend]) })
return resResult(STATUS.SUCCESS, { lot: newLotResult, dividend: processSingleDividendFormat(newDividend) });
} catch (e) {
console.log('offer got err:', e);

View File

@@ -530,6 +530,7 @@ export async function checkAuctionStage(auctionStage: number) {
}
export function processSingleDividendFormat(dividend: DividendType) {
if(!dividend) return null;
let newDividend = { ...dividend, begin: getSeconds(dividend.begin)}
return pick(newDividend, ['serverId', 'guildCode', 'sourceType', 'sourceCode', 'code', 'totalPrice', 'dividends', 'status', 'begin'])
}
@@ -539,6 +540,7 @@ export function processDividendFormat(dividends: DividendType[]) {
}
export function processSingleLotFormat(lot: LotType) {
if(!lot) return null;
let newLot = { ...lot, begin: getSeconds(lot.begin), end: getSeconds(lot.end)}
return pick(newLot, ['auctionStage', 'sourceType', 'sourceCode', 'serverId', 'guildCode', 'code', 'gid', 'count', 'prePrice', 'curPrice', 'curBuyer', 'maxPrice', 'bidRoles', 'watchingRoles', 'begin', 'end', 'status', 'sort'])
}