Browse Source

修复uid空问题

ellisran 1 year ago
parent
commit
facca386dd
1 changed files with 3 additions and 2 deletions
  1. 3 2
      app/controller/tender_controller.js

+ 3 - 2
app/controller/tender_controller.js

@@ -1095,10 +1095,11 @@ module.exports = app => {
                     fujianOssPath: ctx.app.config.fujianOssPath,
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.tender.cert),
                 };
-                const accountList = await ctx.service.projectAccount.getAllDataByCondition({
+                const uidList = ctx.helper._.uniq(ctx.helper._.map(allCertList, 'uid'));
+                const accountList = uidList.length > 0 ? await ctx.service.projectAccount.getAllDataByCondition({
                     where: { project_id: ctx.session.sessionProject.id, enable: 1, id: ctx.helper._.uniq(ctx.helper._.map(allCertList, 'uid')) },
                     columns: ['id', 'name', 'company', 'role', 'enable', 'is_admin', 'account_group', 'mobile'],
-                });
+                }) : [];
                 renderData.accountList = accountList;
                 const unitList = await ctx.service.constructionUnit.getAllDataByCondition({ where: { pid: ctx.session.sessionProject.id } });
                 renderData.accountGroup = unitList.map(item => {