lrf402788946 hace 4 años
padre
commit
3e993e1c26
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      app/service/user.js

+ 2 - 2
app/service/user.js

@@ -166,8 +166,8 @@ class UserService extends CrudService {
   }
 
   async businessuser({ pid, skip, limit }) {
-    assert(pid, '数据错误,缺少pid');
-    const query = { pid, code: { $regex: /^.{9}$/ } };
+    const query = { code: { $regex: /^.{9}$/ } };
+    pid ? query.pid = pid : '';
     const total = await this.model.count(query);
     const data = await this.model
       .find(query)