后台:操作活动组类型

This commit is contained in:
luying
2021-06-17 20:16:43 +08:00
parent ab38a171d4
commit 7132468b86
6 changed files with 51 additions and 2 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ export const COUNTER = {
SERVER_GROUP: { name: 'group', def: 1 },
SERVER_BY_TYPE: { name: 'serverby', def: 1 },
SERVER: { name: 'server', def: 1 },
ACTIVITY_GROUP_TYPE: { name: 'actgrptype', def: 0 }
ACTIVITY_GROUP_TYPE: { name: 'actgrptype', def: 1 }
};
export const DEFAULT_HEROES = [19, 53, 46, 40, 22, 56, 32, 28, 18];
+1
View File
@@ -382,6 +382,7 @@ export const STATUS = {
GM_CAN_NOT_EDIT_ACT: { code: 60016, simStr: '活动期间不可编辑活动' },
GM_STATEGY_NOT_FOUND: { code: 60017, simStr: '未找到该策略' },
GM_SERVER_NOT_FOUND: { code: 60018, simStr: '未找到该服' },
GM_ACTIVITY_GROUP_TYPE_NOT_FOUND: { code: 60019, simStr: '未找到活动组类型' },
// 支付相关状态 70000 - 79999
NO_PRODUCT_ID: { code: 70001, simStr: '无效商品' },
NO_PAY_TYPE: { code: 70002, simStr: '无效支付类型' },
+16
View File
@@ -38,6 +38,22 @@ export default class Activity_GroupType extends BaseModel {
return result;
}
public static async updateActivityGroupType(groupType: number, groupTypeName: string, types: number[], uid = 1) {
let activityTypes = types.map((value, index) => {
return { index: index + 1, activityType: value };
});
let result: ActivityGroupTypeInter = await ActivityGroupTypeModel.findOneAndUpdate({ groupType }, {
$set: { groupTypeName, activityTypes, updatedBy: uid }
}, { new: true }).lean();
return result;
}
public static async deleteActivityGroupType(groupType: number) {
let result = await ActivityGroupTypeModel.deleteMany({ groupType });
return result;
}
private static getSearchObj(form: { groupType?: number, groupTypeName?: string }) {
let searchObj = {};
if(form.groupType != undefined) searchObj['groupType'] = form.groupType;