fix 每日挑战次数限制
This commit is contained in:
@@ -19,10 +19,10 @@ export async function checkDaily(roleId: string, battleId: number, inc: number)
|
||||
if(!curDaily) return { status: -1, resResult: resResult(STATUS.DAILY_TYPE_NOT_FOUND) };
|
||||
let dailyRecord = await DailyRecordModel.refreshRecord(roleId, type);
|
||||
let { count } = dailyRecord;
|
||||
if(count + inc > curDaily.sum ) {
|
||||
if(count + inc > curDaily.timesPerDay ) {
|
||||
return { status: -1, resResult: resResult(STATUS.DAILY_TIMES_LACK) }
|
||||
}
|
||||
return {status: 1, type, count, sum: curDaily.sum};
|
||||
return {status: 1, type, count, sum: curDaily.timesPerDay};
|
||||
}
|
||||
|
||||
// 检查每日本次数warEnd和warSweep使用
|
||||
@@ -43,9 +43,9 @@ export async function checkDailyAndIncrease(roleId: string, battleId: number, in
|
||||
dailyRecord = await DailyRecordModel.getDailyRecordById(roleId, type);
|
||||
}
|
||||
let { count } = dailyRecord;
|
||||
if(count + inc > curDaily.sum ) {
|
||||
if(count + inc > curDaily.timesPerDay ) {
|
||||
return { status: -1, resResult: resResult(STATUS.DAILY_TIMES_LACK) }
|
||||
}
|
||||
let result = await DailyRecordModel.increseDailyCount(roleId, type, inc);
|
||||
return {status: 1, type, count: result.count, sum: curDaily.sum};
|
||||
return {status: 1, type, count: result.count, sum: curDaily.timesPerDay};
|
||||
}
|
||||
Reference in New Issue
Block a user