抽卡:修复转盘积分bug
This commit is contained in:
@@ -123,9 +123,8 @@ export class GachaHandler {
|
||||
let { heroes } = await createHeroes(roleId, roleName, sid, serverId, funcs, heroInfo);
|
||||
await addItems(roleId, roleName, sid, items);
|
||||
// 更新数据
|
||||
point = Math.floor((historyCount + count)/RECRUIT.RECRUIT_BONUS);
|
||||
userGacha = await UserGachaModel.updateInfo(roleId, gachaId, activityId, {
|
||||
freeCount, hope, floor, count: historyCount + count, point
|
||||
freeCount, hope, floor, count: historyCount + count
|
||||
});
|
||||
|
||||
await UserGachaRecModel.createRec(roleId, gachaId, activityId, count, resultList);
|
||||
@@ -139,7 +138,7 @@ export class GachaHandler {
|
||||
}
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
gachaId, activityId,
|
||||
freeCount, refFreeTime: resultRefFreeTime, count: userGacha.count, point, floor, hope,
|
||||
freeCount, refFreeTime: resultRefFreeTime, count: userGacha.count, point: userGacha.point, floor, hope,
|
||||
heroes, result: resultList
|
||||
});
|
||||
}
|
||||
@@ -184,7 +183,8 @@ export class GachaHandler {
|
||||
const funcs: number[] = session.get('funcs');
|
||||
|
||||
let userGacha = await UserGachaModel.findByRole(roleId, gachaId, 0);
|
||||
let { point, turntable } = userGacha;
|
||||
let { point, turntable, costPoint } = userGacha;
|
||||
console.log('***drawTurnTable', point)
|
||||
if (point < RECRUIT.RECRUIT_BONUS_RECRUIT) return resResult(STATUS.GACHA_TURNTABLE_POINT_NOT_ENOUGH);
|
||||
|
||||
let turntablePool: { quality: number, count: number }[] = [];
|
||||
@@ -233,7 +233,7 @@ export class GachaHandler {
|
||||
}
|
||||
myTurntable.hasGet = true;
|
||||
// 扣除积分
|
||||
userGacha = await UserGachaModel.updateInfo(roleId, gachaId, 0, { point: point - 1, turntable });
|
||||
userGacha = await UserGachaModel.updateInfo(roleId, gachaId, 0, { turntable, costPoint: costPoint + 1 });
|
||||
|
||||
return resResult(STATUS.SUCCESS, {
|
||||
gachaId,
|
||||
|
||||
Reference in New Issue
Block a user