zs 1 yıl önce
ebeveyn
işleme
09d25e2005

+ 5 - 2
src/service/application.service.ts

@@ -12,8 +12,6 @@ import { Match } from '../entity/match.entity';
 import { User } from '../entity/user.entity';
 import { Team } from '../entity/team.entity';
 const moment = require('moment');
-// import isEqual = require('lodash/isEqual');
-// import uniqWith = require('lodash/uniqWith');
 type modelType = ReturnModelType<typeof Application>;
 @Provide()
 export class ApplicationService extends BaseService<modelType> {
@@ -76,14 +74,18 @@ export class ApplicationService extends BaseService<modelType> {
   async specialQuery(filter) {
     const { skip = 0, limit = 0, ...info } = filter;
     if (info.user) {
+      // 查询用户信息
       const user = await this.UserModel.findById(info.user);
+      // 判断用户类型
       if (user.type === '0') {
+        // 如何是比赛人员 查询成员中是否包含该用户
         info.user_id = { $elemMatch: { _id: info.user } };
         delete info.user;
         const list: any = await this.model.find(info).skip(skip).limit(limit);
         const total = await this.model.count(info);
         return { list, total };
       } else if (user.type === '1') {
+        // 如何团队管理人员 查询所属管理人员
         info.administrator = info.user;
         delete info.user;
         const list: any = await this.model.find(info).skip(skip).limit(limit);
@@ -91,6 +93,7 @@ export class ApplicationService extends BaseService<modelType> {
         return { list, total };
       }
     } else {
+      // 没有用户信息正常查询
       const list: any = await this.model.find(info).skip(skip).limit(limit);
       const total = await this.model.count(info);
       return { list, total };

+ 1 - 0
src/service/course.service.ts

@@ -14,6 +14,7 @@ export class CourseService extends BaseService<modelType> {
   @InjectEntityModel(Application)
   AppModel: ReturnModelType<typeof Application>;
 
+  // 特殊查询 团队id是红队还是蓝队
   async specialQuery(filter) {
     const { skip = 0, limit = 0, ...info } = filter;
     let obj = {};

+ 1 - 1
src/service/team.service.ts

@@ -8,7 +8,7 @@ type modelType = ReturnModelType<typeof Team>;
 export class TeamService extends BaseService<modelType> {
   @InjectEntityModel(Team)
   model: modelType;
-
+  // 特殊查询 如果有用户信息 就在成员列表中查询
   async specialQuery(filter) {
     const { skip = 0, limit = 0, ...info } = filter;
     if (info.user) info.member = { $in: [info.user] };