后台:活动添加字段

This commit is contained in:
luying
2021-12-21 19:41:00 +08:00
parent 4613de7aa4
commit f02161701c
3 changed files with 18 additions and 16 deletions
+5 -3
View File
@@ -75,11 +75,13 @@ export default class Activity extends BaseModel {
}
//新增活动
public static async addActivity(aids: number[], groupId: number, beginTime: Date, endTime: Date, type: number, data: string, uid = 1) {
public static async addActivity(aids: number[], groupId: number, beginTime: Date, endTime: Date, type: number, data: string, timeType: number, days: number, delayDay: number, interval: number, uid = 1) {
let result: ActivityModelType[] = [];
let newAids = [];
for (let activityId of aids) {
if (!activityId) activityId = await CounterModel.getNewCounter(COUNTER.ACTIVITY);
let update = { type, data }
newAids.push(activityId);
let update = { type, data, timeType, days, delayDay, interval }
if (beginTime != undefined) {
update["beginTime"] = beginTime;
}
@@ -95,7 +97,7 @@ export default class Activity extends BaseModel {
let newGroup = await ActivityGroupModel.createGroup(uid);
groupId = newGroup.groupId;
}
await ActivityGroupModel.addActivitiesToGroupData(groupId, aids, uid);
await ActivityGroupModel.addActivitiesToGroupData(groupId, newAids, uid);
}
return result;
}
+10 -10
View File
@@ -12,7 +12,7 @@
"imageName": "jttubiao_3",
"killReward": "40005&1000",
"ratio": 1,
"damageRewardTotal": "40005&1000",
"damageReward": "40005&1000",
"basicReward": "17052&2",
"encourageSum": 300,
"rewardsPreview": "21013&80|21016&80|21031&80|21054&80|21055&80|21062&80|21063&80|21008&60|21010&60|42124&1|42128&1|42132&1|42136&1|42140&1|42144&1"
@@ -30,7 +30,7 @@
"imageName": "jttubiao_3",
"killReward": "40005&1200",
"ratio": 1,
"damageRewardTotal": "40005&1200",
"damageReward": "40005&1200",
"basicReward": "17052&4",
"encourageSum": 300,
"rewardsPreview": "21013&80|21016&80|21031&80|21054&80|21055&80|21062&80|21063&80|21008&60|21010&60|42124&1|42128&1|42132&1|42136&1|42140&1|42144&1"
@@ -48,7 +48,7 @@
"imageName": "jttubiao_3",
"killReward": "40005&1300",
"ratio": 1,
"damageRewardTotal": "40005&1300",
"damageReward": "40005&1300",
"basicReward": "17052&6",
"encourageSum": 300,
"rewardsPreview": "21013&80|21016&80|21031&80|21054&80|21055&80|21062&80|21063&80|21008&60|21010&60|42124&1|42128&1|42132&1|42136&1|42140&1|42144&1"
@@ -66,7 +66,7 @@
"imageName": "jttubiao_3",
"killReward": "40005&1400",
"ratio": 1,
"damageRewardTotal": "40005&1400",
"damageReward": "40005&1400",
"basicReward": "17052&8",
"encourageSum": 300,
"rewardsPreview": "42136&1|42140&1|42144&1|33123&1|33127&1|33131&1|33135&1|33139&1|33143&1"
@@ -84,7 +84,7 @@
"imageName": "jttubiao_3",
"killReward": "40005&1500",
"ratio": 1,
"damageRewardTotal": "40005&1500",
"damageReward": "40005&1500",
"basicReward": "17052&10",
"encourageSum": 300,
"rewardsPreview": "42136&1|42140&1|42144&1|33123&1|33127&1|33131&1|33135&1|33139&1|33143&1"
@@ -102,7 +102,7 @@
"imageName": "jttubiao_3",
"killReward": "40005&1600",
"ratio": 1,
"damageRewardTotal": "40005&1600",
"damageReward": "40005&1600",
"basicReward": "17052&12",
"encourageSum": 300,
"rewardsPreview": "42136&1|42140&1|42144&1|33123&1|33127&1|33131&1|33135&1|33139&1|33143&1"
@@ -120,7 +120,7 @@
"imageName": "jttubiao_3",
"killReward": "40005&1700",
"ratio": 1,
"damageRewardTotal": "40005&1700",
"damageReward": "40005&1700",
"basicReward": "17052&14",
"encourageSum": 300,
"rewardsPreview": "33131&1|33135&1|33139&1|33143&1|50169&1|50170&1|50171&1"
@@ -138,7 +138,7 @@
"imageName": "jttubiao_3",
"killReward": "40005&1800",
"ratio": 1,
"damageRewardTotal": "40005&1800",
"damageReward": "40005&1800",
"basicReward": "17052&16",
"encourageSum": 300,
"rewardsPreview": "33131&1|33135&1|33139&1|33143&1|50169&1|50170&1|50171&1"
@@ -156,7 +156,7 @@
"imageName": "jttubiao_3",
"killReward": "40005&1900",
"ratio": 1,
"damageRewardTotal": "40005&1900",
"damageReward": "40005&1900",
"basicReward": "17052&18",
"encourageSum": 300,
"rewardsPreview": "33131&1|33135&1|33139&1|33143&1|50169&1|50170&1|50171&1"
@@ -174,7 +174,7 @@
"imageName": "jttubiao_3",
"killReward": "40005&2000",
"ratio": 1,
"damageRewardTotal": "40005&2000",
"damageReward": "40005&2000",
"basicReward": "17052&20",
"encourageSum": 300,
"rewardsPreview": "33131&1|33135&1|33139&1|33143&1|50169&1|50170&1|50171&1"