Explorar el Código

变更令已完成列表所有人可见

laiguoran hace 5 años
padre
commit
9aae39c8c9
Se han modificado 1 ficheros con 10 adiciones y 2 borrados
  1. 10 2
      app/service/change.js

+ 10 - 2
app/service/change.js

@@ -242,7 +242,6 @@ module.exports = app => {
                         this.ctx.session.sessionUser.accountId, tenderId];
                     break;
                 case 2:// 进行中(所有的)
-                case 3:// 已完成(所有的)
                 case 4:// 终止(所有的)
                     sql = 'SELECT a.* FROM ?? AS a WHERE ' +
                         'a.cid IN (SELECT b.cid FROM ?? AS b WHERE b.uid = ? AND a.times = b.times GROUP BY b.cid) AND ' +
@@ -250,6 +249,11 @@ module.exports = app => {
                     sqlParam = [this.tableName, this.ctx.service.changeAudit.tableName,
                         this.ctx.session.sessionUser.accountId, status, tenderId];
                     break;
+                case 3:// 已完成(所有的)
+                    sql = 'SELECT a.* FROM ?? AS a WHERE ' +
+                        'a.status = ? AND a.tid = ? ORDER BY a.in_time DESC';
+                    sqlParam = [this.tableName, status, tenderId];
+                    break;
                 default:
                     break;
             }
@@ -292,7 +296,6 @@ module.exports = app => {
                     const result2 = await this.db.query(sql2, sqlParam2);
                     return result2[0].count;
                 case 2:// 进行中(所有的)
-                case 3:// 已完成(所有的)
                 case 4:// 终止(所有的)
                     const sql3 = 'SELECT count(*) AS count FROM ?? AS a WHERE ' +
                         'a.cid IN (SELECT b.cid FROM ?? AS b WHERE b.uid = ? AND a.times = b.times GROUP BY b.cid) AND a.status = ? AND a.tid = ?';
@@ -300,6 +303,11 @@ module.exports = app => {
                         this.ctx.session.sessionUser.accountId, status, tenderId];
                     const result3 = await this.db.query(sql3, sqlParam3);
                     return result3[0].count;
+                case 3:// 已完成(所有的)
+                    const sql4 = 'SELECT count(*) AS count FROM ?? WHERE status = ? AND tid = ?';
+                    const sqlParam4 = [this.tableName, status, tenderId];
+                    const result4 = await this.db.query(sql4, sqlParam4);
+                    return result4[0].count;
                 default:
                     break;
             }