后台:活动类型表

This commit is contained in:
luying
2021-06-17 17:19:51 +08:00
parent 703a128811
commit 46595fcbed
10 changed files with 194 additions and 21 deletions

View File

@@ -4,6 +4,7 @@ import { GameModel } from './Game';
import { CounterModel } from './Counter';
import { COUNTER } from '../consts';
import { ServerStategyTypeParam } from './ServerStategy';
import { getServerName, getServerGroupName } from '../pubUtils/data';
// 暂时服务器列表是从game表取的之后会转移到使用这张表目前用作查询该服战力中位数
@@ -99,11 +100,11 @@ export default class Serverlist extends BaseModel {
if(groupServerCount > 10) {
groupId = await CounterModel.getNewCounter(COUNTER.SERVER_GROUP);
}
let groupName = '逍遥津' + groupId;
let groupName = getServerGroupName(groupId)||"";
let serverId = await CounterModel.getNewCounter({ name: `${COUNTER.SERVER_BY_TYPE.name}_${serverType}`, def: COUNTER.SERVER_BY_TYPE.def });
let id = await CounterModel.getNewCounter(COUNTER.SERVER);
if(!name) name = '出师表' + id
if(!name) name = getServerName(id)||"";
const doc = new ServerlistModel();
const update = Object.assign(doc.toJSON(), params, { id, serverId, host, groupId, groupName, name, createdBy: uid, updatedBy: uid }, { activityGroupId: stategy.activityGroupId, maxPlayerCnt: stategy.maxPlayerCnt});