瀏覽代碼

修复变更撤回bug

ellisran 1 年之前
父節點
當前提交
3756dd1800
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      app/service/change.js

+ 4 - 4
app/service/change.js

@@ -267,10 +267,10 @@ module.exports = app => {
                 switch (status) {
                     case 0: // 包含你的所有变更令
                         sql =
-                            'SELECT a.* FROM ?? AS a WHERE a.tid = ? AND ' +
-                            '(a.uid = ? OR (a.status != ? AND a.cid IN (SELECT b.cid FROM ?? AS b WHERE b.uid = ? AND a.times = b.times GROUP BY b.cid))' +
+                            'SELECT a.* FROM ?? AS a WHERE a.tid = ? AND' +
+                            ' (a.uid = ? OR (a.status != ? AND a.cid IN (SELECT b.cid FROM ?? AS b WHERE b.uid = ? AND a.times = b.times GROUP BY b.cid))' +
                             ' OR (a.status = ? AND a.cid IN (SELECT b.cid FROM ?? AS b WHERE b.uid = ? AND a.times - 1 = b.times GROUP BY b.cid))' +
-                            'OR a.status = ? )' + stateSql;
+                            ' OR a.status = ?)' + stateSql;
                         sqlParam = [
                             this.tableName,
                             tenderId,
@@ -1903,7 +1903,7 @@ module.exports = app => {
                 } else {
                     const lastAuditors = await this.service.changeAudit.getAuditors(change.cid, change.times - 1);
                     const onAuditor = this._.findLast(lastAuditors, { status: auditStatus.back });
-                    if (onAuditor.uid === accountId) {
+                    if (onAuditor && onAuditor.uid === accountId) {
                         change.cancancel = 4;// 审批人撤回退回原报
                     }
                 }