军团:修改拍卖行价格

This commit is contained in:
luying
2022-01-13 17:23:19 +08:00
parent ae847e06c7
commit f09f5b0d63
3 changed files with 15 additions and 12 deletions

View File

@@ -210,15 +210,15 @@ export async function genAuction(guildCode: string, sourceType: number, sourceCo
return {
auctionStage: AUCTION_STAGE.DEFAULT, sourceType,
sourceCode, serverId, guildCode, code, gid: id, count, begin, end, status: LOT_STATUS.DEFAULT,
maxPrice, curPrice: basePrice, sort
maxPrice, curPrice: basePrice, prePrice: 0, sort
}
});
const lots = await LotModel.createRecs(lotsData);
const dividendCode = genCode(DIVIDEND_CODE_LEN);
const dividendData: DividendParam = {
guildCode, sourceType, sourceCode, serverId, code: dividendCode, dividends: [], totalPrice: 0, begin, lots: lots.map(lot => {
const { code, gid } = lot;
return { code, gid, price: 0, time: guildEnd, max: false, count: lot.count }
const { code, gid, curPrice } = lot;
return { code, gid, price: curPrice, time: guildEnd, max: false, count: lot.count }
}),
};
const dividend = await DividendModel.createDividend(dividendData);
@@ -402,7 +402,7 @@ export function auctionBidStatus(roleId: string, lot: LotParam) {
export function guildBidStatus(lot: { max: boolean, gid: number, count: number, price: number, dividendStatus: number }) {
const { max, gid, count, price: lotPrice, dividendStatus } = lot;
return max || lotPrice === getMaxPrice(gid, count) || ((dividendStatus == DIVIDEND_STATUS.END || dividendStatus == DIVIDEND_STATUS.SENT) && lotPrice !== 0)
return max || ((dividendStatus == DIVIDEND_STATUS.END || dividendStatus == DIVIDEND_STATUS.SENT) && lotPrice !== 0)
}
export async function sendUngotDividend(debug = false) {