寻宝:修改奖励
This commit is contained in:
@@ -45,6 +45,13 @@ export default class FriendPoint extends BaseModel {
|
||||
return rec;
|
||||
}
|
||||
|
||||
public static async updateComBattleCntToday(roleId: string, roleName: string, cntInc: number, maxPerDay: number, type: number, lean = true) {
|
||||
const curTime = getZeroPointD();
|
||||
// 当 oldCnt + cntInc > maxPerDay 时需计算实际可以获得的点数:cntInc - (newCnt - maxPerDay)
|
||||
const rec: FriendPointType = await FriendPointModel.findOneAndUpdate({roleId, roleName, createdAt: {$gte: curTime}, comBattleCnt: {$lt: maxPerDay}, type}, {$inc: {comBattleCnt: cntInc}}, {upsert: true, new: true}).lean(lean);
|
||||
return rec;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 某个类型当天情谊点获取情况
|
||||
* @static
|
||||
|
||||
Reference in New Issue
Block a user