拍卖行:推送
This commit is contained in:
@@ -38,7 +38,7 @@ export default class Api extends BaseModel {
|
||||
|
||||
}
|
||||
|
||||
export let ApiModel: ReturnModelType<typeof Api, {}>;
|
||||
export let ApiModel: ReturnModelType<typeof Api, {}> = getModelForClass(Api);
|
||||
export function loadApiModel(connect: mongoose.Connection) {
|
||||
ApiModel = getModelForClass(Api, {
|
||||
existingConnection: connect
|
||||
|
||||
@@ -93,6 +93,8 @@ export default class Dividend extends BaseModel {
|
||||
|
||||
public static async updateDividendsStatus(begin: Date, status: number) {
|
||||
await DividendModel.updateMany({ begin }, { status });
|
||||
const result: DividendType[] = await DividendModel.find({ begin }).select('-_id -__v').lean();
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ export default class GMGroup extends BaseModel {
|
||||
|
||||
}
|
||||
|
||||
export let GMGroupModel: ReturnModelType<typeof GMGroup, {}>;
|
||||
export let GMGroupModel: ReturnModelType<typeof GMGroup, {}> = getModelForClass(GMGroup);
|
||||
export function loadGMGroupModel(connect: mongoose.Connection) {
|
||||
GMGroupModel = getModelForClass(GMGroup, {
|
||||
existingConnection: connect
|
||||
|
||||
@@ -28,7 +28,7 @@ export default class GMRecord extends BaseModel {
|
||||
|
||||
}
|
||||
|
||||
export let GMRecordModel: ReturnModelType<typeof GMRecord, {}>;
|
||||
export let GMRecordModel: ReturnModelType<typeof GMRecord, {}> = getModelForClass(GMRecord);
|
||||
export function loadGMRecordModel(connect: mongoose.Connection) {
|
||||
GMRecordModel = getModelForClass(GMRecord, {
|
||||
existingConnection: connect
|
||||
|
||||
@@ -85,7 +85,7 @@ export default class GMUser extends BaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
export let GMUserModel: ReturnModelType<typeof GMUser, {}>;
|
||||
export let GMUserModel: ReturnModelType<typeof GMUser, {}> = getModelForClass(GMUser);
|
||||
export function loadGMUserModel(connect: mongoose.Connection) {
|
||||
GMUserModel = getModelForClass(GMUser, {
|
||||
existingConnection: connect
|
||||
|
||||
@@ -32,7 +32,7 @@ export default class GMUserGroup extends BaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
export let GMUserGroupModel: ReturnModelType<typeof GMUserGroup, {}>;
|
||||
export let GMUserGroupModel: ReturnModelType<typeof GMUserGroup, {}> = getModelForClass(GMUserGroup);
|
||||
export function loadGMUserGroupModel(connect: mongoose.Connection) {
|
||||
GMUserGroupModel = getModelForClass(GMUserGroup, {
|
||||
existingConnection: connect
|
||||
|
||||
@@ -122,12 +122,14 @@ export default class Lot extends BaseModel {
|
||||
}
|
||||
|
||||
public static async updateLotsStageByBegin(begin: Date, auctionStage: number) {
|
||||
const results = await LotModel.updateMany({ begin }, { auctionStage }).select('-_id -__v').lean();
|
||||
await LotModel.updateMany({ begin }, { auctionStage });
|
||||
const results: LotType[] = await LotModel.find({ begin }).select('-_id -__v').lean();
|
||||
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();
|
||||
await LotModel.updateMany({ begin, status: { $in: [LOT_STATUS.DEFAULT, LOT_STATUS.ING] } }, { auctionStage });
|
||||
const results: LotType[] = await LotModel.find({ begin, status: { $in: [LOT_STATUS.DEFAULT, LOT_STATUS.ING] } }).select('-_id -__v').lean();
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user