拍卖行:调整字段

This commit is contained in:
liangtongchuan
2021-03-19 01:16:58 +08:00
parent a1c5c18b4a
commit 5b2cdc6829
3 changed files with 5 additions and 4 deletions

View File

@@ -152,8 +152,8 @@ export class AuctionHandler {
const lotsData = await LotModel.recentBidLots(serverId, roleId, msg.count);
const bidRecs = lotsData.map(lot => {
const bidRec = lot.bidRoles.find(role => { return role.roleId === roleId });
const { curBuyer } = lot;
return { ...bidRec, status: curBuyer === roleId ? AUCTION_BID_STATUS.SUC : AUCTION_BID_STATUS.RETURN };
const { curBuyer, gid } = lot;
return { ...bidRec, gid, status: curBuyer === roleId ? AUCTION_BID_STATUS.SUC : AUCTION_BID_STATUS.RETURN };
});
return resResult(STATUS.SUCCESS, { bidRecs });
}

View File

@@ -253,6 +253,7 @@ describe('拍卖行测试', function() {
expect(bidRec.price).to.be.a('number');
expect(Date.parse(bidRec.time)).to.be.a('number');
expect(bidRec.status).to.be.a('number');
expect(bidRec.gid).to.be.a('number');
}
done();
});