活动:转盘修改记录

This commit is contained in:
luying
2022-03-02 10:03:04 +08:00
parent 7ab714ec25
commit d0eb46ece4
4 changed files with 18 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ export default class Activity_Turntable_Rec extends BaseModel {
@prop({ required: true })
refTodayCount: Date; // 本日抽卡刷新时间
@prop({ required: true, type: TurntableRecord })
@prop({ required: true, type: TurntableRecord, _id: false })
records: TurntableRecord[]; // 本日抽卡刷新时间
@prop({ required: true, type: Number })

View File

@@ -96,7 +96,7 @@ export class LuckyTurntableData extends ActivityBase {
}
public pull(roleName: string, count: number) {
let records: TurntableRecord[] = [];
let records: (string|number)[][] = [];
let result: number[] = [];
let goodResult: RewardInter[] = [];
for(let i = 0; i < count; i++) {
@@ -114,7 +114,7 @@ export class LuckyTurntableData extends ActivityBase {
this.count++;
this.todayCount++;
let record = { roleName, gid: randResult.gid, count: randResult.count };
records.push(record);
records.push([record.roleName, record.gid, record.count]);
this.records.push(record);
result.push(randResult.id);
goodResult.push({ id: randResult.gid, count: randResult.count });
@@ -171,8 +171,9 @@ export class LuckyTurntableData extends ActivityBase {
public getShowResult() {
return {
...pick(this, ['cost', 'freeCount', 'todayCount', 'count', 'box', 'records']),
pool: this.pool.map(pool => pool.getShowResult())
...pick(this, ['cost', 'freeCount', 'todayCount', 'count', 'box']),
pool: this.pool.map(pool => pool.getShowResult()),
records: this.records.map(record => [record.roleName, record.gid, record.count])
}
}

View File

@@ -232,5 +232,11 @@
"activityType": 39,
"name": "NEW_HERO_GACHA",
"string": "新将擢迁(新武将抽取)"
},
{
"id": 40,
"activityType": 40,
"name": "LUCKY_TURNTABLE",
"string": "幸运转盘"
}
]