活动:修改活动bug
This commit is contained in:
@@ -24,6 +24,6 @@ export abstract class ActivityBase {
|
||||
this.type = activityData.type;
|
||||
// this.data = activityData.data;
|
||||
this.todayIndex = deltaDays(activityData.beginTime, new Date) + 1;
|
||||
console.log('今天是活动第几天', activityData.beginTime, new Date, this.todayIndex)
|
||||
// console.log('今天是活动第几天', activityData.beginTime, new Date, this.todayIndex)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { TASK_TYPE, ACTIVITY_RESOURCES_TYPE } from '../../consts';
|
||||
import { ActivityModelType } from '../../db/Activity';
|
||||
import { ActivityGrowthModelType } from '../../db/ActivityGrowth';
|
||||
import { ActivityGrowthPointModelType } from '../../db/ActivityGrowthPoint';
|
||||
import { RoleModel } from '../../db/Role';
|
||||
import { RewardInter } from '../../pubUtils/interface';
|
||||
import { parseGoodStrWithType, parseHeroStrWithType, splitString } from '../../pubUtils/util';
|
||||
import { CreateHeroParam } from '../roleField/hero';
|
||||
@@ -174,12 +175,17 @@ export class GrowthData extends ActivityBase {
|
||||
}
|
||||
|
||||
//解析玩家领取记录
|
||||
public setPlayerRecords(data: ActivityGrowthModelType[]) {
|
||||
public async setPlayerRecords(data: ActivityGrowthModelType[], roleId: string) {
|
||||
let { heroNum } = await RoleModel.findByRoleId(roleId);
|
||||
for (let obj of this.list) {
|
||||
let index = data.findIndex(record => { return obj.dayIndex == record.dayIndex && obj.cellIndex == record.cellIndex })
|
||||
if (index != -1) {
|
||||
obj.totalCount = data[index].totalCount ? data[index].totalCount : 0;
|
||||
obj.receiveRewardCount = data[index].receiveRewardCount ? data[index].receiveRewardCount : 0;
|
||||
} else {
|
||||
if (obj.taskType === TASK_TYPE.HERO_NUM) {
|
||||
obj.totalCount = heroNum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user