|
@@ -45,9 +45,10 @@ export class ApplicationService extends BaseService<modelType> {
|
|
}
|
|
}
|
|
if (data.team_id) {
|
|
if (data.team_id) {
|
|
// 检查申请记录
|
|
// 检查申请记录
|
|
- const apply = await this.model.count({
|
|
|
|
|
|
+ let apply = await this.model.count({
|
|
match_id: data.match_id,
|
|
match_id: data.match_id,
|
|
team_id: data.team_id,
|
|
team_id: data.team_id,
|
|
|
|
+ status: '0',
|
|
});
|
|
});
|
|
if (apply > 0) {
|
|
if (apply > 0) {
|
|
throw new ServiceError(
|
|
throw new ServiceError(
|
|
@@ -55,6 +56,18 @@ export class ApplicationService extends BaseService<modelType> {
|
|
FrameworkErrorEnum.BAD_BODY
|
|
FrameworkErrorEnum.BAD_BODY
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
+ // 检查申请记录
|
|
|
|
+ apply = await this.model.count({
|
|
|
|
+ match_id: data.match_id,
|
|
|
|
+ team_id: data.team_id,
|
|
|
|
+ status: '1',
|
|
|
|
+ });
|
|
|
|
+ if (apply > 0) {
|
|
|
|
+ throw new ServiceError(
|
|
|
|
+ '申请参加比赛已通过 请勿重复操作!',
|
|
|
|
+ FrameworkErrorEnum.BAD_BODY
|
|
|
|
+ );
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|