活动:任务积分支持多活动id
This commit is contained in:
@@ -10,7 +10,7 @@ import { DicDailyTask, DicAchievement, DicMainTask } from "../../../pubUtils/dic
|
|||||||
import { getMainTask, refDailyTaskBox, removeHistoryTask, getCurTask, checkTask } from "../../../services/taskService";
|
import { getMainTask, refDailyTaskBox, removeHistoryTask, getCurTask, checkTask } from "../../../services/taskService";
|
||||||
import { TASK } from "../../../pubUtils/dicParam";
|
import { TASK } from "../../../pubUtils/dicParam";
|
||||||
import { newHeroGiftPoint } from "../../../services/activity/newHeroGiftsService";
|
import { newHeroGiftPoint } from "../../../services/activity/newHeroGiftsService";
|
||||||
import { ActivityTaskPointModel } from "../../../db/ActivityTaskPoint";
|
import { ActivityTaskPointModel, ActivityTaskPointModelType } from "../../../db/ActivityTaskPoint";
|
||||||
import { ItemInter } from "../../../pubUtils/interface";
|
import { ItemInter } from "../../../pubUtils/interface";
|
||||||
import { RoleModel } from "../../../db/Role";
|
import { RoleModel } from "../../../db/Role";
|
||||||
import { roleLevelup } from "../../../services/normalBattleService";
|
import { roleLevelup } from "../../../services/normalBattleService";
|
||||||
@@ -71,11 +71,11 @@ export class ShopHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//任务完成后关联活动的积分
|
//任务完成后关联活动的积分
|
||||||
let activityTaskPoint = await ActivityTaskPointModel.findData(type, id);
|
let activityTaskPoint: ActivityTaskPointModelType[] = await ActivityTaskPointModel.findData(type, id);
|
||||||
if (activityTaskPoint) {
|
for (let obj of activityTaskPoint) {
|
||||||
await newHeroGiftPoint(serverId, activityTaskPoint.activityId, roleId, activityTaskPoint.point);
|
await newHeroGiftPoint(serverId, obj.activityId, roleId, obj.point);
|
||||||
let uids = [{ uid: roleId, sid }];
|
let uids = [{ uid: roleId, sid }];
|
||||||
this.app.get('channelService').pushMessageByUids('addPoint', resResult(STATUS.SUCCESS, { activityId: activityTaskPoint.activityId, addPoint: point }), uids);
|
this.app.get('channelService').pushMessageByUids('addPoint', resResult(STATUS.SUCCESS, { activityId: obj.activityId, addPoint: point }), uids);
|
||||||
}
|
}
|
||||||
|
|
||||||
let goods = await addItems(roleId, roleName, sid, taskReward);
|
let goods = await addItems(roleId, roleName, sid, taskReward);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default class Activity_Task_Point extends BaseModel {
|
|||||||
|
|
||||||
//查询数据
|
//查询数据
|
||||||
public static async findData(taskType: number, taskId: number) {
|
public static async findData(taskType: number, taskId: number) {
|
||||||
let result: ActivityTaskPointModelType = await ActivityTaskPointModel.findOne(
|
let result: ActivityTaskPointModelType[] = await ActivityTaskPointModel.find(
|
||||||
{ taskType, taskId }).lean(true);
|
{ taskType, taskId }).lean(true);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user