军团:试炼表修改
This commit is contained in:
@@ -5,6 +5,7 @@ import { genCode } from '../pubUtils/util';
|
||||
import { GUILD_STRUCTURE, GUILD_STATUS, GUILD_PER_PAGE, GUILD_SELECT, REDIS_KEY, SHOP_REFRESH_TYPE } from '../consts';
|
||||
import { getZeroPoint, nowSeconds } from '../pubUtils/timeUtil';
|
||||
import { reduceCe } from '../pubUtils/util';
|
||||
import { gameData } from '../pubUtils/data';
|
||||
|
||||
class Structure {
|
||||
@prop({ required: true })
|
||||
@@ -237,7 +238,8 @@ export default class Guild extends BaseModel {
|
||||
*/
|
||||
public static async resetGuildTrain(code: string, serverId: number, trainLv: number, lean = true) {
|
||||
const time = getZeroPoint(SHOP_REFRESH_TYPE.WEEKLY);//每周一,5点刷新
|
||||
const result = await GuildModel.findOneAndUpdate({ code, status: GUILD_STATUS.RUNNING, serverId, resetTrainTime:{$ne:time}},{$set: {trainId: 1, resetTrainTime: time, trainLv}}, {new: true}).lean(lean);
|
||||
const newTrainId = gameData.firstGuildTrainIdOfLv.get(trainLv);
|
||||
const result = await GuildModel.findOneAndUpdate({ code, status: GUILD_STATUS.RUNNING, serverId, resetTrainTime:{$ne:time}},{$set: {trainId: newTrainId, resetTrainTime: time, trainLv}}, {new: true}).lean(lean);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user