zs 2 vuotta sitten
vanhempi
commit
e2c78fe1d2
1 muutettua tiedostoa jossa 4 lisäystä ja 13 poistoa
  1. 4 13
      src/service/application.service.ts

+ 4 - 13
src/service/application.service.ts

@@ -80,23 +80,14 @@ export class ApplicationService extends BaseService<modelType> {
       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);
-        const total = await this.model.count(info);
-        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 };
+      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 };
   }
 }