活动:弹出礼包订单添加参数
This commit is contained in:
@@ -636,7 +636,7 @@ export enum TASK_TYPE {
|
||||
ROLE_TERAPH_STAGE_UP = 82, // 神像进阶
|
||||
EQUIP_QUALITY_COUNT = 83, // 获得*件品质的*装备
|
||||
HERO_WAKE_UP_COUNT = 84, // *名武将觉醒
|
||||
GUILD_ACTIVITY_END = 85, // 参与*军团活动到结束
|
||||
GUILD_JOIN_ACTIVITY_END = 85, // 参与*军团活动到结束
|
||||
}
|
||||
|
||||
// 卡池类型
|
||||
|
||||
@@ -392,5 +392,6 @@ export const STATUS = {
|
||||
ACTIVITY_TYPE_ERROR: { code: 70010, simStr: '活动类型错误' },
|
||||
ACTIVITY_NO_PRODUCT: { code: 70011, simStr: '活动数据错误' },
|
||||
ERROR_TYPE: { code: 70012, simStr: '未知活动类型' },
|
||||
ORDER_PARAM_ERROR: { code: 70013, simStr: '订单参数错误' },
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType } from '@typegoose/typegoose';
|
||||
import moment = require('moment');
|
||||
|
||||
|
||||
/**
|
||||
@@ -32,11 +33,10 @@ export default class Activity_Pop_Up_Shop extends BaseModel {
|
||||
isPush: boolean; // 是否推送过
|
||||
|
||||
//购买记录
|
||||
public static async addRecord(serverId: number, activityId: number, roleId: string, id: number, type: number, buyCount: number) {
|
||||
let nowDate = new Date();
|
||||
public static async addRecord(serverId: number, activityId: number, roleId: string, id: number, type: number, buyCount: number, beginTime: Date) {
|
||||
let result: ActivityPopUpShopModelType = await ActivityPopUpShopModel.findOneAndUpdate({
|
||||
serverId, roleId, activityId, id, type,
|
||||
beginTime: { $lt: nowDate }, endTime: { $gt: nowDate }
|
||||
beginTime: beginTime
|
||||
},
|
||||
{ $inc: { buyCount: buyCount } }, { upsert: true, new: true }).lean(true);
|
||||
return result;
|
||||
@@ -61,16 +61,16 @@ export default class Activity_Pop_Up_Shop extends BaseModel {
|
||||
return result;
|
||||
}
|
||||
|
||||
//根据活动taskId查询现在正在开启的商店数据
|
||||
public static async findOpenDataByTaskId(serverId: number, activityId: number, roleId: string, id: number, type: number) {
|
||||
let nowDate = new Date();
|
||||
//根据活动开始时间查询现在正在开启的商店数据
|
||||
public static async findDataByBeginTime(serverId: number, activityId: number, roleId: string, id: number, type: number, beginTime: Date) {
|
||||
console.log('beginTime', serverId, roleId, activityId, id, type, beginTime)
|
||||
let result: ActivityPopUpShopModelType = await ActivityPopUpShopModel.findOne({
|
||||
serverId, roleId, activityId, id, type,
|
||||
beginTime: { $lt: nowDate }, endTime: { $gt: nowDate }
|
||||
serverId, roleId, activityId, id, type, beginTime: beginTime
|
||||
}).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//根据活动统计完成任务次数
|
||||
public static async setTaskCount(serverId: number, activityId: number, roleId: string, id: number, type: number, count: number) {
|
||||
let result: ActivityPopUpShopModelType = await ActivityPopUpShopModel.findOneAndUpdate({ serverId, roleId, activityId, id, type },
|
||||
|
||||
@@ -29,6 +29,8 @@ export default class UserOrder extends BaseModel {
|
||||
message: string; // 信息
|
||||
@prop({ required: true })
|
||||
activityId: number; // 活动ID
|
||||
@prop({ required: true })
|
||||
paramStr: string; // 订单参数
|
||||
|
||||
|
||||
//保存平台订单号
|
||||
@@ -101,9 +103,9 @@ export default class UserOrder extends BaseModel {
|
||||
|
||||
|
||||
//新增订单
|
||||
public static async applyOrder(serverId: number, roleId: string, productID: string, localOrderID: string, orderID: string, price: number, payType: number, activityId: number, message: string = '') {
|
||||
public static async applyOrder(serverId: number, roleId: string, productID: string, localOrderID: string, orderID: string, price: number, payType: number, activityId: number, paramStr: string, message: string) {
|
||||
let result: UserOrderModelType = await UserOrderModel.findOneAndUpdate({ serverId, roleId, productID, localOrderID, orderID, payType, activityId },
|
||||
{ $set: { price, state: ORDER_STATE.APPLY, message } },
|
||||
{ $set: { price, state: ORDER_STATE.APPLY, message, paramStr: paramStr ? paramStr : '' } },
|
||||
{ upsert: true, new: true }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1125,12 +1125,16 @@ export function isComplete(roleId: string, taskType: TASK_TYPE, taskParam: strin
|
||||
addCount = count;
|
||||
break;
|
||||
}
|
||||
|
||||
case TASK_TYPE.COM_BATTLE_ASSIST_TEAM:
|
||||
{
|
||||
addCount = count;
|
||||
break;
|
||||
}
|
||||
case TASK_TYPE.GUILD_JOIN_ACTIVITY_END:
|
||||
{
|
||||
addCount = count;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
addCount = 0;
|
||||
break;
|
||||
|
||||
@@ -754,5 +754,14 @@
|
||||
"string": "武将数量",
|
||||
"content": 0,
|
||||
"condition": "herocount"
|
||||
},
|
||||
{
|
||||
"id": 85,
|
||||
"name": "军团",
|
||||
"info": "参与*军团活动到结束",
|
||||
"param": "aid&",
|
||||
"string": "武将数量",
|
||||
"content": "aid-1.蛮夷 2.诸侯 3.粮草,aid=0就是任意军团活动类型",
|
||||
"condition": "herocount"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user