删掉注释的代码
This commit is contained in:
@@ -495,6 +495,8 @@ export async function accomplishTask(serverId: number, roleId: string, taskType:
|
||||
if(activities) {
|
||||
let result: ActivityModelType[] = [];
|
||||
for(let activity of activities) {
|
||||
// getActivities -> activities 获取所有结束时间在当前以后的活动
|
||||
// types: 活动类型
|
||||
if(activityGroupId.includes(activity.groupId) && types.includes(activity.type)) {
|
||||
result.push(activity);
|
||||
}
|
||||
@@ -509,67 +511,6 @@ export async function accomplishTask(serverId: number, roleId: string, taskType:
|
||||
}
|
||||
}
|
||||
let { createTime } = await RoleModel.findByRoleId(roleId);
|
||||
// //成长活动统计
|
||||
// let allActivity: ActivityModelType[] = await ActivityModel.findOpenActivityByType(activityGroupId, ACTIVITY_TYPE.TASK_GROWTH, new Date());
|
||||
// for (let activity of allActivity) {
|
||||
// let growthActivity = new GrowthData(activity);
|
||||
// let taskArray = growthActivity.findTaskByType(taskType);
|
||||
// for (let task of taskArray) {
|
||||
// let taskRecord = await ActivityGrowthModel.findDataByCellIndex(serverId, growthActivity.activityId, roleId, task.dayIndex, task.cellIndex, task.taskType)
|
||||
// let recordData = taskRecord && taskRecord.data ? JSON.parse(taskRecord.data) : null;
|
||||
// let { addCount, record } = isComplete(roleId, task.taskType, task.taskParam, count, parma, recordData);
|
||||
// if (addCount) {
|
||||
// if (taskType == TASK_TYPE.ROLE_LV || taskType == TASK_TYPE.ROLE_TITLE || taskType == TASK_TYPE.BATTLE_TOWER_LV) {
|
||||
// let playerRecord = await ActivityGrowthModel.setTaskCount(serverId, growthActivity.activityId, roleId, task.dayIndex, task.cellIndex, task.taskType, addCount);
|
||||
// //推送
|
||||
// task.totalCount = playerRecord.totalCount;
|
||||
// task.receiveRewardCount = playerRecord.receiveRewardCount ? playerRecord.receiveRewardCount : 0;
|
||||
// pushMessage = pushMessage.concat(Object.assign(task, { activityId: growthActivity.activityId }));
|
||||
// } else {
|
||||
// let playerRecord = await ActivityGrowthModel.addTaskCount(serverId, growthActivity.activityId, roleId, task.dayIndex, task.cellIndex, task.taskType, addCount);
|
||||
// //推送
|
||||
// task.totalCount = playerRecord.totalCount;
|
||||
// task.receiveRewardCount = playerRecord.receiveRewardCount ? playerRecord.receiveRewardCount : 0;
|
||||
// pushMessage = pushMessage.concat(Object.assign(task, { activityId: growthActivity.activityId }));
|
||||
// }
|
||||
// }
|
||||
// if (record) {
|
||||
// await ActivityGrowthModel.addTaskRecord(serverId, growthActivity.activityId, roleId, task.dayIndex, task.cellIndex, task.taskType, JSON.stringify(record));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //今日挑战统计
|
||||
// allActivity = await ActivityModel.findOpenActivityByType(activityGroupId, ACTIVITY_TYPE.TASK_DAILY_CHALLENGES, new Date());
|
||||
// for (let activity of allActivity) {
|
||||
// let growthActivity = new DailyChallengesData(activity);
|
||||
// let taskArray = growthActivity.findTaskByType(taskType, growthActivity.today());
|
||||
// for (let task of taskArray) {
|
||||
// let taskRecord = await ActivityDailyChallengesModel.findDataByCellIndex(serverId, growthActivity.activityId, roleId, task.dayIndex, task.cellIndex, task.taskType)
|
||||
// let recordData = taskRecord && taskRecord.data ? JSON.parse(taskRecord.data) : null
|
||||
// let { addCount, record } = isComplete(roleId, task.taskType, task.taskParam, count, parma, recordData);
|
||||
// if (addCount) {
|
||||
// if (taskType == TASK_TYPE.ROLE_LV || taskType == TASK_TYPE.ROLE_TITLE || taskType == TASK_TYPE.BATTLE_TOWER_LV) {
|
||||
// let playerRecord = await ActivityDailyChallengesModel.setTaskCount(serverId, growthActivity.activityId, roleId, task.dayIndex, task.cellIndex, task.taskType, addCount);
|
||||
// //推送
|
||||
// task.totalCount = playerRecord.totalCount;
|
||||
// task.receiveRewardCount = playerRecord.receiveRewardCount ? playerRecord.receiveRewardCount : 0;
|
||||
// pushMessage = pushMessage.concat(Object.assign(task, { activityId: growthActivity.activityId }));
|
||||
// } else {
|
||||
// let playerRecord = await ActivityDailyChallengesModel.addTaskCount(serverId, growthActivity.activityId, roleId, task.dayIndex, task.cellIndex, task.taskType, addCount);
|
||||
// //推送
|
||||
// task.totalCount = playerRecord.totalCount;
|
||||
// task.receiveRewardCount = playerRecord.receiveRewardCount ? playerRecord.receiveRewardCount : 0;
|
||||
// pushMessage = pushMessage.concat(Object.assign(task, { activityId: growthActivity.activityId }));
|
||||
// }
|
||||
// }
|
||||
// if (record) {
|
||||
// await ActivityGrowthModel.addTaskRecord(serverId, growthActivity.activityId, roleId, task.dayIndex, task.cellIndex, task.taskType, JSON.stringify(record));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// console.log('***** sevenDay before', Date.now());
|
||||
//七天乐
|
||||
let allActivity: ActivityModelType[] = await findActivitiesByTypes([ACTIVITY_TYPE.SEVEN_DAY]);
|
||||
for (let activity of allActivity) {
|
||||
|
||||
Reference in New Issue
Block a user