lrf402788946 4 年之前
父节点
当前提交
3e993e1c26
共有 1 个文件被更改,包括 2 次插入2 次删除
  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 }) {
   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 total = await this.model.count(query);
     const data = await this.model
     const data = await this.model
       .find(query)
       .find(query)