Преглед изворни кода

归档报表展示3种数据bug

ellisran пре 1 година
родитељ
комит
377bcd3543
3 измењених фајлова са 3 додато и 3 уклоњено
  1. 1 1
      app/service/change_apply.js
  2. 1 1
      app/service/change_plan.js
  3. 1 1
      app/service/change_project.js

+ 1 - 1
app/service/change_apply.js

@@ -442,7 +442,7 @@ module.exports = app => {
 
         async getListByArchives(tid, ids) {
             if (ids.length === 0) return [];
-            const sql = 'SELECT a.* FROM ?? as c LEFT JOIN (SELECT caid, MAX(end_time) as end_time FROM ?? WHERE ' +
+            const sql = 'SELECT c.* FROM ?? as c LEFT JOIN (SELECT caid, MAX(end_time) as end_time FROM ?? WHERE ' +
                 'tid = ? AND caid in (' + this.ctx.helper.getInArrStrSqlFilter(ids) + ') GROUP BY caid) as ca ON c.id = ca.caid WHERE' +
                 ' c.tid = ? AND c.id in (' + this.ctx.helper.getInArrStrSqlFilter(ids) + ') AND c.status = ? ORDER BY ca.end_time DESC';
             const params = [this.tableName, this.ctx.service.changeApplyAudit.tableName, tid, tid, audit.status.checked];

+ 1 - 1
app/service/change_plan.js

@@ -465,7 +465,7 @@ module.exports = app => {
 
         async getListByArchives(tid, ids) {
             if (ids.length === 0) return [];
-            const sql = 'SELECT a.* FROM ?? as c LEFT JOIN (SELECT cpid, MAX(end_time) as end_time FROM ?? WHERE ' +
+            const sql = 'SELECT c.* FROM ?? as c LEFT JOIN (SELECT cpid, MAX(end_time) as end_time FROM ?? WHERE ' +
                 'tid = ? AND cpid in (' + this.ctx.helper.getInArrStrSqlFilter(ids) + ') GROUP BY cpid) as ca ON c.id = ca.cpid WHERE' +
                 ' c.tid = ? AND c.id in (' + this.ctx.helper.getInArrStrSqlFilter(ids) + ') AND c.status = ? ORDER BY ca.end_time DESC';
             const params = [this.tableName, this.ctx.service.changePlanAudit.tableName, tid, tid, audit.status.checked];

+ 1 - 1
app/service/change_project.js

@@ -416,7 +416,7 @@ module.exports = app => {
 
         async getListByArchives(tid, ids) {
             if (ids.length === 0) return [];
-            const sql = 'SELECT a.* FROM ?? as c LEFT JOIN (SELECT cpid, MAX(end_time) as end_time FROM ?? WHERE ' +
+            const sql = 'SELECT c.* FROM ?? as c LEFT JOIN (SELECT cpid, MAX(end_time) as end_time FROM ?? WHERE ' +
                 'tid = ? AND cpid in (' + this.ctx.helper.getInArrStrSqlFilter(ids) + ') GROUP BY cpid) as ca ON c.id = ca.cpid WHERE' +
                 ' c.tid = ? AND c.id in (' + this.ctx.helper.getInArrStrSqlFilter(ids) + ') AND c.status = ? ORDER BY ca.end_time DESC';
             const params = [this.tableName, this.ctx.service.changeProjectAudit.tableName, tid, tid, audit.status.checked];