活动:添加军团活动任务
This commit is contained in:
@@ -40,19 +40,19 @@ export class PopUpShopHandler {
|
||||
|
||||
/**
|
||||
* @description 购买礼包
|
||||
* @param {{ activityId: number, id: number, beginTime: Date}} msg
|
||||
* @param {{ activityId: number, id: number, beginTimeStamp: number}} msg
|
||||
* @param {BackendSession} session
|
||||
* @memberof PopUpShopHandler
|
||||
*/
|
||||
async buyGift(msg: { activityId: number, id: number, beginTime: Date }, session: BackendSession) {
|
||||
const { activityId, id, beginTime } = msg;
|
||||
async buyGift(msg: { activityId: number, id: number, beginTimeStamp: number }, session: BackendSession) {
|
||||
const { activityId, id, beginTimeStamp } = msg;
|
||||
const roleId = session.get('roleId');
|
||||
const serverId = session.get('serverId');
|
||||
const sid = session.get('sid');
|
||||
const roleName = session.get('roleName');
|
||||
const funcs: number[] = session.get('funcs');
|
||||
let beginTime = moment(beginTimeStamp).toDate();
|
||||
|
||||
let beginDate = moment(beginTime).toDate();
|
||||
let activityData: ActivityModelType = await ActivityModel.findActivity(activityId);
|
||||
if (!activityData) {
|
||||
return resResult(STATUS.ACTIVITY_MISSING);
|
||||
@@ -74,7 +74,7 @@ export class PopUpShopHandler {
|
||||
return resResult(STATUS.ACTIVITY_NEED_PAY);
|
||||
}
|
||||
|
||||
let playerRecords: ActivityPopUpShopModelType = await ActivityPopUpShopModel.findDataByBeginTime(serverId, activityId, roleId, id, playerData.taskType, beginDate);
|
||||
let playerRecords: ActivityPopUpShopModelType = await ActivityPopUpShopModel.findDataByBeginTime(serverId, activityId, roleId, id, playerData.taskType, beginTime);
|
||||
if (!playerRecords) {
|
||||
return resResult(STATUS.ACTIVITY_POP_UP_SHOP_EXPIRE);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ export class PopUpShopHandler {
|
||||
let rewardParamArr: Array<RewardParam> = stringToRewardParam(playerData.reward);
|
||||
let result = await addReward(roleId, roleName, sid, serverId, funcs, rewardParamArr)
|
||||
|
||||
await ActivityPopUpShopModel.addRecord(serverId, activityId, roleId, id, playerData.taskType, 1, beginDate);
|
||||
await ActivityPopUpShopModel.addRecord(serverId, activityId, roleId, id, playerData.taskType, 1, beginTime);
|
||||
|
||||
playerData.buyCount += 1;
|
||||
return resResult(STATUS.SUCCESS, Object.assign(result, {
|
||||
|
||||
Reference in New Issue
Block a user