拍卖行:修复世界拍卖的时候整理格式报错
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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'])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user