✨ feat(兼容): 配表使用后台隐藏物品
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user