拍卖行:出价后更新分红

This commit is contained in:
liangtongchuan
2021-03-18 08:11:54 +08:00
parent 3cc1ff2760
commit 5de951b31c
2 changed files with 10 additions and 3 deletions
@@ -63,8 +63,9 @@ export class AuctionHandler {
bidRoles.push({roleId, price: newPrice, time: new Date()});
const newLot = await LotModel.updateLot({ code, curBuyer: roleId, curPrice: newPrice, bidRoles});
// TODO 更新分红
return resResult(STATUS.SUCCESS, { lot: newLot });
const incPrice = newPrice - (curBuyer ? curPrice : 0);
const dividend = await DividendModel.updateLot(code, gid, newPrice, incPrice);
return resResult(STATUS.SUCCESS, { lot: newLot, dividend });
}
async watchLot(msg: { code: string }, session: BackendSession) {