|
@@ -52,6 +52,7 @@ class UserService extends CrudService {
|
|
|
const coach = await this.baseCoachModel.findById(coach_id);
|
|
|
if (!coach) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到教练信息');
|
|
|
const { user_id } = coach;
|
|
|
+ // user_id: 基础模块 的 用户表 数据id
|
|
|
return await this.userToBeJudge({ user_id, parent_id });
|
|
|
}
|
|
|
|
|
@@ -59,8 +60,8 @@ class UserService extends CrudService {
|
|
|
async userToBeJudge({ user_id, parent_id }) {
|
|
|
assert(user_id, '缺少裁判用户信息');
|
|
|
assert(parent_id, '缺少赛事创建方信息');
|
|
|
- const user = await this.model.findById(user_id);
|
|
|
- if (!user) throw new BusinessError(ErrorCode.USER_NOT_EXIST, '未找到比赛模块用户信息');
|
|
|
+ const user = await this.baseUserModel.findById(user_id);
|
|
|
+ if (!user) throw new BusinessError(ErrorCode.USER_NOT_EXIST, '未找到基础模块用户信息');
|
|
|
const { openid } = user;
|
|
|
const obj = { user_id, parent_id, type: '2', openid };
|
|
|
return this.bindJudge(obj);
|