优化:拍卖推送减少数据

This commit is contained in:
luying
2022-01-26 16:36:03 +08:00
parent b67e4448df
commit c909d899ba
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ export default class Dividend extends BaseModel {
public static async createDividend(data: DividendParam) { public static async createDividend(data: DividendParam) {
const code = genCode(8); const code = genCode(8);
const docData = new DividendModel(); const docData = new DividendModel();
const result: DividendType = await DividendModel.findOneAndUpdate({ code }, { ...docData.toJSON(), ...data, code }, { upsert: true, new: true }).select('-_id -__v').lean(); const result: DividendType = await DividendModel.findOneAndUpdate({ code }, { ...docData.toJSON(), ...data, code }, { upsert: true, new: true }).select('-_id -__v -createdAt -updatedAt').lean();
return result; return result;
} }
@@ -93,7 +93,7 @@ export default class Dividend extends BaseModel {
public static async updateDividendsStatus(begin: Date, status: number) { public static async updateDividendsStatus(begin: Date, status: number) {
await DividendModel.updateMany({ begin }, { status }); await DividendModel.updateMany({ begin }, { status });
const result: DividendType[] = await DividendModel.find({ begin }).select('-_id -__v').lean(); const result: DividendType[] = await DividendModel.find({ begin }).select('-_id -__v -createdAt -updatedAt').lean();
return result return result
} }
} }
+1 -1
View File
@@ -125,7 +125,7 @@ export default class Lot extends BaseModel {
public static async updateLotsStageByBegin(begin: Date, auctionStage: number) { public static async updateLotsStageByBegin(begin: Date, auctionStage: number) {
await LotModel.updateMany({ begin }, { auctionStage }); await LotModel.updateMany({ begin }, { auctionStage });
const results: LotType[] = await LotModel.find({ begin }).select('-_id -__v').lean(); const results: LotType[] = await LotModel.find({ begin }).select('-_id -__v -createdAt -updatedAt').lean();
return results; return results;
} }