|
@@ -651,76 +651,14 @@ export class MatchExtController implements BaseController {
|
|
await this.service.update({ match_id }, { status: '8' });
|
|
await this.service.update({ match_id }, { status: '8' });
|
|
await this.matchRegService.update({ match_id, ext_status: '7', final_confirm: '0' }, { ext_status: '8' });
|
|
await this.matchRegService.update({ match_id, ext_status: '7', final_confirm: '0' }, { ext_status: '8' });
|
|
}
|
|
}
|
|
-
|
|
+
|
|
- @Get('/firstStep/:match_id', { routerName: '进入初审阶段' })
|
|
+ * 人为规定的决赛实时名单
|
|
- async toFirstStep(@Param('match_id') match_id: string, @Body() data: object) {
|
|
+ * @param match_id 赛事id
|
|
-
|
|
+ * @returns
|
|
-
|
|
+ */
|
|
- const extData = await this.service.fetch({ match_id });
|
|
+ @Post('/lastList/:match_id', { routerName: '赛事决赛名单' })
|
|
- if (extData) {
|
|
+ async lastList(@Param('match_id') match_id: string) {
|
|
- const nowStatus = get(extData, 'status');
|
|
+ const list = await this.matchRegService.getArrangeList(match_id)
|
|
-
|
|
+ return list;
|
|
-
|
|
|
|
-
|
|
|
|
- await this.service.update({ match_id }, { status: '1' });
|
|
|
|
- }
|
|
|
|
- const start_time = get(data, 'start_time');
|
|
|
|
- const regQuery = { match_id, status: '0' };
|
|
|
|
- await this.matchRegService.update(regQuery, { start_time });
|
|
|
|
-
|
|
|
|
- const { data: list } = await this.matchRegService.query(regQuery);
|
|
|
|
-
|
|
|
|
- const matchData = await this.matchService.fetch({ id: match_id });
|
|
|
|
-
|
|
|
|
- const msg = `您参加的赛事: ${get(matchData, 'name')} 将于 ${start_time}开始初审,具体安排请通过网页或小程序查看.请您提前做好准备.`;
|
|
|
|
- for (const i of list) {
|
|
|
|
- const user_id = get(i, 'user_id');
|
|
|
|
- if (!user_id) continue;
|
|
|
|
- const ups = await this.service.getUserProps(user_id, ['phone']);
|
|
|
|
- const phone = get(ups, 'phone');
|
|
|
|
- try {
|
|
|
|
- await this.smsService.send(phone, msg);
|
|
|
|
- } catch (error) {
|
|
|
|
- console.error('matchExt - toFirstStep:发送短信发生错误');
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Post('/secondStep/:match_id', { routerName: '进入决赛准备阶段' })
|
|
|
|
- async toSecondStep(@Param('match_id') match_id: string, @Body() data: object) {
|
|
|
|
-
|
|
|
|
- const extData = await this.service.fetch({ match_id });
|
|
|
|
- const final_persons = get(data, 'final_persons');
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- if (extData) {
|
|
|
|
- const nowStatus = get(extData, 'status');
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- await this.service.update({ match_id }, { status: '2', final_persons });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- const query = { match_id };
|
|
|
|
- const others = { skip: 0, limit: final_persons, others: { score: 'DESC' } };
|
|
|
|
- const { data: list } = await this.matchRegService.query(query, others);
|
|
|
|
-
|
|
|
|
- const matchData = await this.matchService.fetch({ id: match_id });
|
|
|
|
- const match_name = get(matchData, 'name');
|
|
|
|
- const msg = `您在赛事: ${match_name}中已进入决赛,请通过网站或小程序进入平台进行信息确认.`;
|
|
|
|
- const lastList = [];
|
|
|
|
- for (const i of list) {
|
|
|
|
- const user_id = get(i, 'user_id');
|
|
|
|
- if (!user_id) continue;
|
|
|
|
-
|
|
|
|
- const ups = await this.service.getUserProps(user_id, ['phone']);
|
|
|
|
- const phone = get(ups, 'phone');
|
|
|
|
- try {
|
|
|
|
- await this.smsService.send(phone, msg);
|
|
|
|
- } catch (error) {
|
|
|
|
- console.error('matchExt - toSecondStep:发送短信发生错误');
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|