拍卖:拍品收藏

This commit is contained in:
luying
2022-09-21 10:46:55 +08:00
parent d66de07dc5
commit cbb0e4221c
4 changed files with 5 additions and 5 deletions

View File

@@ -193,7 +193,7 @@ export async function genAuction(guildCode: string, sourceType: number, sourceCo
return {
auctionStage: AUCTION_STAGE.DEFAULT, sourceType,
sourceCode, serverId, guildCode, code, gid: id, count, begin, end, status: LOT_STATUS.DEFAULT,
maxPrice, curPrice: basePrice, prePrice: 0, sort, bidRoles: []
maxPrice, curPrice: basePrice, prePrice: 0, sort, bidRoles: [], watchingRoles: []
}
});
const lots = await LotModel.createRecs(lotsData);

View File

@@ -868,7 +868,7 @@ export function getDeclareIndex() {
export function getJoinIndex() {
let index = getGAIndexInPinus(GUILD_ACTIVITY_TYPE.RACE_ACTIVITY);
let obj = getRaceActivityObj();
if(obj.status == GUILD_ACTIVITY_STATUS.START) return index;
if(obj.status == GUILD_ACTIVITY_STATUS.START || obj.status == GUILD_ACTIVITY_STATUS.END) return index;
return index + 1;
}

View File

@@ -87,14 +87,14 @@ export default class GuildActivityRecord extends BaseModel {
public static async updateInfo(guildCode: string, aid: number, index: number, update: GuildActivityRecordUpdateParam) {
let rec: GuildActivityRecordType = await GuildActivityRecordModel.findOneAndUpdate(
{ guildCode, aid, index, status: 1 },
{ $set: update }, { new: true, upsert: true }).lean();
{ $set: update, $setOnInsert: { code: genCode(10) } }, { new: true, upsert: true }).lean();
return rec;
}
public static async pushEvent(guildCode: string, aid: number, index: number, event: Event) {
let rec: GuildActivityRecordType = await GuildActivityRecordModel.findOneAndUpdate(
{ guildCode, index, aid, status: 1 },
{ $push: { events: event } }, { new: true, upsert: true }).lean();
{ $push: { events: event }, $setOnInsert: { code: genCode(10) } }, { new: true, upsert: true }).lean();
return rec;
}

View File

@@ -75,7 +75,7 @@ export default class Lot extends BaseModel {
}
public static async findGuildLotsByBegin(guildCode: string, begin: Date) {
const results = await LotModel.find({ guildCode, begin, auctionStage: AUCTION_STAGE.GUILD }).sort({ sort: 1 }).select('-_id -__v').lean();
const results = await LotModel.find({ guildCode, begin, auctionStage: { $in: [AUCTION_STAGE.DEFAULT, AUCTION_STAGE.GUILD] } }).sort({ sort: 1 }).select('-_id -__v').lean();
return results;
}