活动:转盘修改记录

This commit is contained in:
luying
2022-03-04 09:47:24 +08:00
parent 7ab714ec25
commit d0eb46ece4
4 changed files with 18 additions and 6 deletions
@@ -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])
}
}