✨ feat(兼容): 配表使用后台隐藏物品

This commit is contained in:
luying
2022-11-10 11:11:28 +08:00
parent 5d0873630a
commit 53d4af4e09
54 changed files with 768 additions and 102 deletions
+23
View File
@@ -22,6 +22,7 @@ import { SurveyModel } from '@db/Survery';
import { RedisClient } from 'redis';
import { ChannelInfoModel } from '@db/ChannelInfo';
import { PVPConfigModel } from '@db/PvpConfig';
import { HiddenDataByIdModel } from '@db/HiddenDataById';
/**
* Test Service
@@ -324,4 +325,26 @@ export default class Game extends Service {
list, total
});
}
public async getHiddenData(page: number, pageSize: number, sortField: string, sortOrder: string, form: any) {
const { ctx } = this;
const list = await HiddenDataByIdModel.findByCondition(page, pageSize, sortField, sortOrder, form);
const total = await HiddenDataByIdModel.countByCondition(form);
return ctx.service.utils.resResult(STATUS.SUCCESS, {
list: list.map(cur => {
return { ...cur, env: this.app.config.realEnv }
}), total
});
}
public async getExistHiddenData(type: number) {
const { ctx } = this;
let datas = await HiddenDataByIdModel.findExistData(type);
let existIds = datas.map(cur => cur.id);
return ctx.service.utils.resResult(STATUS.SUCCESS, {
ids: existIds
});
}
}