|
@@ -13,6 +13,7 @@ class MatchSignService extends CrudService {
|
|
|
this.matchGroupModel = this.ctx.model.Race.MatchGroup;
|
|
|
this.matchProjectModel = this.ctx.model.Race.MatchProject;
|
|
|
this.billModel = this.ctx.model.Race.Bill;
|
|
|
+ this.userModel = this.ctx.model.Race.User;
|
|
|
this.baseUserModel = this.ctx.model.Base.User;
|
|
|
}
|
|
|
/**
|
|
@@ -30,9 +31,12 @@ class MatchSignService extends CrudService {
|
|
|
|
|
|
async afterQuery(filter, data) {
|
|
|
for (const i of data) {
|
|
|
- const { user_id } = data;
|
|
|
+ const { user_id: raceUser_id } = i;
|
|
|
+ const raceUser = await this.userModel.findById(raceUser_id);
|
|
|
+ if (!raceUser) continue;
|
|
|
+ const { user_id } = raceUser;
|
|
|
const user = await this.baseUserModel.findById(user_id);
|
|
|
- if (user) i.user_name = user.name;
|
|
|
+ if (user)i.user_name = user.name;
|
|
|
}
|
|
|
return data;
|
|
|
}
|