From ac4d2dbf84321d9494c67bed6597f02d1d7c01b3 Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Thu, 18 Mar 2021 00:02:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=8D=E5=8D=96=E8=A1=8C=EF=BC=9A=E5=88=A0?= =?UTF-8?q?=E6=8E=89=20magic=20number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/auctionService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 });