拍卖:拍品收藏

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
+1 -1
View File
@@ -193,7 +193,7 @@ export async function genAuction(guildCode: string, sourceType: number, sourceCo
return { return {
auctionStage: AUCTION_STAGE.DEFAULT, sourceType, auctionStage: AUCTION_STAGE.DEFAULT, sourceType,
sourceCode, serverId, guildCode, code, gid: id, count, begin, end, status: LOT_STATUS.DEFAULT, 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); const lots = await LotModel.createRecs(lotsData);
@@ -868,7 +868,7 @@ export function getDeclareIndex() {
export function getJoinIndex() { export function getJoinIndex() {
let index = getGAIndexInPinus(GUILD_ACTIVITY_TYPE.RACE_ACTIVITY); let index = getGAIndexInPinus(GUILD_ACTIVITY_TYPE.RACE_ACTIVITY);
let obj = getRaceActivityObj(); 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; return index + 1;
} }
+2 -2
View File
@@ -87,14 +87,14 @@ export default class GuildActivityRecord extends BaseModel {
public static async updateInfo(guildCode: string, aid: number, index: number, update: GuildActivityRecordUpdateParam) { public static async updateInfo(guildCode: string, aid: number, index: number, update: GuildActivityRecordUpdateParam) {
let rec: GuildActivityRecordType = await GuildActivityRecordModel.findOneAndUpdate( let rec: GuildActivityRecordType = await GuildActivityRecordModel.findOneAndUpdate(
{ guildCode, aid, index, status: 1 }, { 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; return rec;
} }
public static async pushEvent(guildCode: string, aid: number, index: number, event: Event) { public static async pushEvent(guildCode: string, aid: number, index: number, event: Event) {
let rec: GuildActivityRecordType = await GuildActivityRecordModel.findOneAndUpdate( let rec: GuildActivityRecordType = await GuildActivityRecordModel.findOneAndUpdate(
{ guildCode, index, aid, status: 1 }, { 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; return rec;
} }
+1 -1
View File
@@ -75,7 +75,7 @@ export default class Lot extends BaseModel {
} }
public static async findGuildLotsByBegin(guildCode: string, begin: Date) { 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; return results;
} }