diff --git a/game-server/app/services/auctionService.ts b/game-server/app/services/auctionService.ts index 64f2cea5c..369a64d98 100644 --- a/game-server/app/services/auctionService.ts +++ b/game-server/app/services/auctionService.ts @@ -1,5 +1,5 @@ import { DividendModel } from './../db/Dividend'; -import { LOT_CODE_LEN, AUCTION_STAGE, AUCTION_TIME, DIVIDEND_CODE_LEN } from './../consts'; +import { LOT_CODE_LEN, AUCTION_STAGE, AUCTION_TIME, DIVIDEND_CODE_LEN, DIVIDEND_STATUS } from './../consts'; import { DividendRec, ItemReward } from "../domain/dbGeneral"; import { genCode } from '../pubUtils/util'; import { LotModel, LotParam } from '../db/Lot'; @@ -82,7 +82,7 @@ function weekendDividend(totalPrice: number, roleNum: number, date: Date) { export async function calculateDividend(dividend: DividendType) { const { code, guildCode, sourceType, sourceCode, lots, totalPrice, status, end } = dividend; - if (status === 3) return null; + if (status === DIVIDEND_STATUS.SENT) return null; const calcuTotalPrice = lots.reduce((acc, lot) => { return acc + lot.price }, 0); if (calcuTotalPrice !== totalPrice) { await DividendModel.updateDividend(code, { totalPrice: calcuTotalPrice });