From 81f0997304acca4166bd3958a018a6f72e6a48f1 Mon Sep 17 00:00:00 2001 From: luying Date: Tue, 8 Nov 2022 20:01:04 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix(=E6=8B=8D=E5=8D=96=E8=A1=8C)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=A5=96=E5=8A=B1=E5=B9=B6=E5=8F=91=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/db/Lot.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/db/Lot.ts b/shared/db/Lot.ts index 3ac444653..15ff6228f 100644 --- a/shared/db/Lot.ts +++ b/shared/db/Lot.ts @@ -54,6 +54,8 @@ export default class Lot extends BaseModel { status: number; // 拍品状态,0:无人竞拍;1:竞拍中;2:已竞拍;3:一口价 @prop({ required: true, default: 0 }) sort: number; // 排序 + @prop({ required: true, default: 0 }) + sendMail: boolean; // 是否是发邮件去的 public static async createRec(data: LotParam) { const code = genCode(8); @@ -145,8 +147,8 @@ export default class Lot extends BaseModel { } public static async setLotSoldByBegin(begin: Date, saveAuctionStage: number) { - const results: LotType[] = await LotModel.find({ begin, status: LOT_STATUS.ING }).sort({ sort: 1 }).select('-_id -__v').lean(); - await LotModel.updateMany({ begin, status: LOT_STATUS.ING }, { status: LOT_STATUS.SOLD, saveAuctionStage }); + await LotModel.updateMany({ begin, status: LOT_STATUS.ING }, { $set: { status: LOT_STATUS.SOLD, saveAuctionStage, sendMail: true } }); + const results: LotType[] = await LotModel.find({ begin, status: LOT_STATUS.SOLD, saveAuctionStage, sendMail: true }).sort({ sort: 1 }).select('-_id -__v').lean(); return results; }