拍卖行:获取军团拍卖记录;修改分红机制
This commit is contained in:
@@ -61,13 +61,18 @@ export default class Dividend extends BaseModel {
|
||||
return results;
|
||||
}
|
||||
|
||||
public static async findDividendsByGuild(guildCode: string, count: number) {
|
||||
const results = await DividendModel.find({ guildCode }).limit(count).sort({ _id: -1 }).select('-_id -__v').lean();
|
||||
return results;
|
||||
}
|
||||
|
||||
public static async updateDividend(code: string, update: DividendParam) {
|
||||
const result = await DividendModel.findOneAndUpdate({ code }, { ...update }, { new: true }).select('-_id -__v').lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static async updateLot(lotCode: string, gid: number, price: number, incPrice: number) {
|
||||
const result = await DividendModel.findOneAndUpdate({ 'lots.code': lotCode }, { 'lots.$.gid': gid, 'lots.$.price': price, $inc: { totalPrice: incPrice} }, { new: true }).select('-_id -__v').lean();
|
||||
public static async updateLot(lotCode: string, gid: number, price: number, incPrice: number, max: boolean) {
|
||||
const result = await DividendModel.findOneAndUpdate({ 'lots.code': lotCode }, { 'lots.$.gid': gid, 'lots.$.price': price, 'lots.$.time': new Date(), 'lots.$.max': max, $inc: { totalPrice: incPrice} }, { new: true }).select('-_id -__v').lean();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user