Revert "✨ feat(db): 修改role表数据库操作方式"
This reverts commit e39af3649288cc5802739cfe862c818fe56e194e.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Application, BackendSession, HandlerService, } from 'pinus';
|
||||
import { EventRecordModel } from '../../../db/EventRecord';
|
||||
import Role from '../../../db/Role';
|
||||
import { RoleModel } from '../../../db/Role';
|
||||
import { EVENT_STATUS, EVENT_RECORD_STATUS, EVENT_ANSWER_STATUS, TASK_TYPE, DEBUG_MAGIC_WORD, ITEM_CHANGE_REASON, EVENT_TYPE, EVENT_QUIZ_NUM } from '../../../consts';
|
||||
import { checkEventStatus, getEventSuccessStatus, getEvent, checkQuiz, startEvent, refreshEvent, getEventTime, randomPosition, randomQuestion } from '../../../services/eventSercive';
|
||||
import { addItems } from '../../../services/role/rewardService';
|
||||
@@ -115,7 +115,7 @@ export class EventBattleHandler {
|
||||
let reward = isSuccess ? dicEvent.winReward : dicEvent.loseReward;
|
||||
let goods = await addItems(roleId, roleName, sid, reward, ITEM_CHANGE_REASON.EVENT_REWARD);
|
||||
if (eventStatus == EVENT_STATUS.STARTING) { // 如果是第一次开启的挑战,保存成开启状态
|
||||
await Role.setEventStatus(roleId, EVENT_STATUS.OPEN);
|
||||
await RoleModel.setEventStatus(roleId, EVENT_STATUS.OPEN);
|
||||
// 第一场时间挑战完,开始正常刷新事件,所以刷新时间也重置起来
|
||||
session.set('eventStatus', EVENT_STATUS.OPEN);
|
||||
session.push('eventStatus', () => { });
|
||||
|
||||
Reference in New Issue
Block a user