优化:拍卖推送减少数据
This commit is contained in:
@@ -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
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user