laiguoran 4 سال پیش
والد
کامیت
70c9c16c1a
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 3 0
      app/service/change.js
  2. 1 1
      app/service/change_audit.js

+ 3 - 0
app/service/change.js

@@ -607,6 +607,7 @@ module.exports = app => {
                     const nextAudit_update = {
                         id: postData.audit_next_id,
                         status: audit.flow.auditStatus.checking,
+                        sin_time: new Date(),
                     };
                     await this.transaction.update(this.ctx.service.changeAudit.tableName, nextAudit_update);
 
@@ -860,6 +861,7 @@ module.exports = app => {
                     usite: lastauditInfo.usite,
                     usort,
                     status: audit.flow.auditStatus.checking,
+                    sin_time: new Date(),
                 };
                 await this.transaction.insert(this.ctx.service.changeAudit.tableName, insert_audit1);
                 usort++;
@@ -1158,6 +1160,7 @@ module.exports = app => {
                     usite: auditInfo.usite,
                     usort,
                     status: audit.flow.auditStatus.checking,
+                    sin_time: new Date(),
                 };
                 await this.transaction.insert(this.ctx.service.changeAudit.tableName, insert_audit2);
 

+ 1 - 1
app/service/change_audit.js

@@ -270,7 +270,7 @@ module.exports = app => {
                 '    t.`name`, t.`type`, t.`user_id` ' +
                 '  FROM ?? AS ca, ?? AS c, ?? As t ' +
                 '  WHERE ca.`uid` = ? and ca.`status` = ? and c.`status` != ?' +
-                '    and ca.`cid` = c.`cid` and ca.`tid` = t.`id`';
+                '    and ca.`cid` = c.`cid` and ca.`tid` = t.`id` ORDER BY ca.`sin_time` DESC';
             const sqlParam = [this.tableName, this.ctx.service.change.tableName, this.ctx.service.tender.tableName, uid, 2, audit.flow.status.uncheck];
             const changes = await this.db.query(sql, sqlParam);
             for (const c of changes) {