拍卖行:已拍出的拍品不进入世界拍卖
This commit is contained in:
@@ -180,7 +180,7 @@ export async function startWorldAuction() {
|
|||||||
console.log('schedule startWorldAuction called:', new Date());
|
console.log('schedule startWorldAuction called:', new Date());
|
||||||
const begin = todayGuildBegin();
|
const begin = todayGuildBegin();
|
||||||
await LotModel.setLotSoldByBegin(begin);
|
await LotModel.setLotSoldByBegin(begin);
|
||||||
await LotModel.updateLotsStageByBegin(begin, AUCTION_STAGE.WORLD);
|
await LotModel.updateUnSoldLotsStageByBegin(begin, AUCTION_STAGE.WORLD);
|
||||||
await DividendModel.updateDividendsStatus(begin, DIVIDEND_STATUS.END);
|
await DividendModel.updateDividendsStatus(begin, DIVIDEND_STATUS.END);
|
||||||
return true;
|
return true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -123,6 +123,11 @@ export default class Lot extends BaseModel {
|
|||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static async updateUnSoldLotsStageByBegin(begin: Date, auctionStage: number) {
|
||||||
|
const results = await LotModel.updateMany({ begin, status: { $in: [LOT_STATUS.DEFAULT, LOT_STATUS.ING] } }, { auctionStage }).select('-_id -__v').lean();
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
public static async setLotSoldByBegin(begin: Date) {
|
public static async setLotSoldByBegin(begin: Date) {
|
||||||
const results = await LotModel.updateMany({ begin, status: LOT_STATUS.ING }, { status: LOT_STATUS.SOLD }).select('-_id -__v').lean();
|
const results = await LotModel.updateMany({ begin, status: LOT_STATUS.ING }, { status: LOT_STATUS.SOLD }).select('-_id -__v').lean();
|
||||||
return results;
|
return results;
|
||||||
|
|||||||
Reference in New Issue
Block a user