소스 검색

修复支付审批sort顺序bug

ellisran 1 년 전
부모
커밋
802be63c2b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/service/payment_detail_audit.js

+ 1 - 1
app/service/payment_detail_audit.js

@@ -77,7 +77,7 @@ module.exports = app => {
          */
          */
         async getAuditors(detailId, times = 1) {
         async getAuditors(detailId, times = 1) {
             const sql = 'SELECT la.`aid`, pa.`name`, pa.`company`, pa.`role`, pa.`mobile`, pa.`telephone`, la.`times`, la.`order`, la.`status`, la.`opinion`, la.`begin_time`, la.`end_time`, g.`sort` ' +
             const sql = 'SELECT la.`aid`, pa.`name`, pa.`company`, pa.`role`, pa.`mobile`, pa.`telephone`, la.`times`, la.`order`, la.`status`, la.`opinion`, la.`begin_time`, la.`end_time`, g.`sort` ' +
-                'FROM ?? AS la, ?? AS pa, (SELECT `aid`,(@i:=@i+1) as `sort` FROM ??, (select @i:=0) as it WHERE `td_id` = ? AND `times` = ? GROUP BY `aid`) as g ' +
+                'FROM ?? AS la, ?? AS pa, (SELECT t.`aid`, t.`sort` FROM (SELECT `aid`,(@i:=@i+1) as `sort` FROM ??, (select @i:=0) as it WHERE `td_id` = ? AND `times` = ? ORDER BY `order`) t GROUP BY t.`aid`) as g ' +
                 'WHERE la.`td_id` = ? and la.`times` = ? and la.`aid` = pa.`id` and g.`aid` = la.`aid` order by la.`order`';
                 'WHERE la.`td_id` = ? and la.`times` = ? and la.`aid` = pa.`id` and g.`aid` = la.`aid` order by la.`order`';
             const sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, this.tableName, detailId, times, detailId, times];
             const sqlParam = [this.tableName, this.ctx.service.projectAccount.tableName, this.tableName, detailId, times, detailId, times];
             const result = await this.db.query(sql, sqlParam);
             const result = await this.db.query(sql, sqlParam);