Explorar el Código

Merge branch 'main' of http://git.cc-lotus.info/Information/cxyy-service

lrf hace 4 meses
padre
commit
61fb11c141

+ 7 - 7
src/controller/match/matchRegistration.controller.ts

@@ -29,7 +29,7 @@ export class MatchRegistrationController implements BaseController {
   async index(@Query() query: object) {
     const qobj = omit(query, ['skip', 'limit']);
     const others: any = pick(query, ['skip', 'limit']);
-    others.order = { order_num: 'ASC' };
+    others.order = { time: 'ASC' };
     const result = await this.service.query(qobj, others);
     return result;
   }
@@ -70,13 +70,13 @@ export class MatchRegistrationController implements BaseController {
       regData = { user_id: dbData.id, ...regData };
     }
     // 检查是否报名
-    const query = { match_id: get(data, 'match_id'), user_id: get(regData, 'user_id') }
-    const { total } = await this.service.query(query)
-    if (total > 0) throw new ServiceError(ErrorCode.MATCH_USER_HAS_REGISTED)
+    const query = { match_id: get(data, 'match_id'), user_id: get(regData, 'user_id') };
+    const { total } = await this.service.query(query);
+    if (total > 0) throw new ServiceError(ErrorCode.MATCH_USER_HAS_REGISTED);
     // 制作项目编号
-    const { total: matchRegTotal = 0 } = await this.service.query({ match_id: get(data, 'match_id') })
-    const no = `${get(data, 'match_id')}-${get(regData, 'user_id')}-${matchRegTotal + 1}`
-    regData = { ...regData, no, time: dayjs().format('YYYY-MM-DD HH:mm:ss') }
+    const { total: matchRegTotal = 0 } = await this.service.query({ match_id: get(data, 'match_id') });
+    const no = `${get(data, 'match_id')}-${get(regData, 'user_id')}-${matchRegTotal + 1}`;
+    regData = { ...regData, no, time: dayjs().format('YYYY-MM-DD HH:mm:ss') };
     const result = await this.service.create(regData);
     return result;
   }

+ 1 - 1
src/controller/platform/match.controller.ts

@@ -36,7 +36,7 @@ export class MatchController implements BaseController {
   async fetch(@Param('id') id: number) {
     const data = await this.service.fetch({ id });
     let result = new FVO_match(data);
-    const extData = await this.matchExtService.fetch({ match_id: id })
+    const extData = await this.matchExtService.fetch({ match_id: id });
     result = Object.assign(result, { ext_info: get(extData, 'info', []), ext_finals: get(extData, 'finals', []) });
     return result;
   }