lrf 3 年 前
コミット
894498240b
1 ファイル変更2 行追加2 行削除
  1. 2 2
      app/service/users/personal.js

+ 2 - 2
app/service/users/personal.js

@@ -15,7 +15,7 @@ class PersonalService extends CrudService {
     super(ctx, 'personal');
     this.redis = this.app.redis;
     this.model = this.ctx.model.Personal;
-    this.orgModel = this.ctx.model.Organization;
+    this.adminModel = this.ctx.model.Admin;
     this.util = this.ctx.service.util.util;
   }
   async query(condition, { skip = 0, limit = 0 }) {
@@ -33,7 +33,7 @@ class PersonalService extends CrudService {
     condition = this.util.dealQuery(condition);
     if (role === 1) {
       //code查询机构,取出机构的code,用code到model(个人用户)里查询用户,合为一个数组,返回
-      const orgRes = await this.orgModel.find({ code }, { code: 1 });
+      const orgRes = await this.adminModel.find({ code }, { code: 1 });
       const codes = orgRes.map((i) => i.code);
       condition.code = codes;
     } else {