瀏覽代碼

根据期审批判断标段查看权限

laiguoran 5 年之前
父節點
當前提交
c6850b4fdd
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      app/service/stage_audit.js

+ 4 - 2
app/service/stage_audit.js

@@ -67,9 +67,11 @@ module.exports = app => {
         async getAllAuditors(tenderId) {
             const sql = 'SELECT sa.aid, sa.tid FROM ' + this.tableName + ' sa' +
                 '  LEFT JOIN ' + this.ctx.service.tender.tableName + ' t On sa.tid = t.id' +
-                '  WHERE t.id = ?' +
+                ' LEFT JOIN ?? s On s.id = sa.sid' +
+                '  WHERE t.id = ? and ((s.status != ? and s.times = sa.times) or (s.status = ? and s.times-1 = sa.times))' +
                 '  GROUP BY  sa.aid';
-            const sqlParam = [tenderId];
+            const sqlParam = [this.ctx.service.stage.tableName, tenderId, auditConst.status.checkNo, auditConst.status.checkNo];
+            // console.log(sql, sqlParam);
             return this.db.query(sql, sqlParam);
         }