|
@@ -20,11 +20,6 @@ class MatchService extends CrudService {
|
|
|
async getAll({ id }) {
|
|
|
let data = await this.model.findById(id);
|
|
|
if (!data) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到赛事信息');
|
|
|
-
|
|
|
- const conn = this.app.mongooseDB.get('base');
|
|
|
- const schema = _.get(this.ctx.model, 'Base.User.schema');
|
|
|
- const m = conn.model('User', schema);
|
|
|
-
|
|
|
data = JSON.parse(JSON.stringify(data));
|
|
|
const match_id = data._id;
|
|
|
let groups = await this.matchGroupModel.find({ match_id });
|
|
@@ -37,9 +32,10 @@ class MatchService extends CrudService {
|
|
|
const { _id: project_id } = project;
|
|
|
let signs = await this.matchSignModel.find({ match_id, group_id, project_id }).populate({
|
|
|
path: 'user_id',
|
|
|
+ model: this.ctx.model.Race.User,
|
|
|
populate: {
|
|
|
path: 'user_id',
|
|
|
- model: m,
|
|
|
+ model: this.ctx.model.Base.User,
|
|
|
},
|
|
|
});
|
|
|
signs = JSON.parse(JSON.stringify(signs));
|