Selaa lähdekoodia

新建标段失败相关

MaiXinRong 6 vuotta sitten
vanhempi
commit
7ff4dfd359
2 muutettua tiedostoa jossa 7 lisäystä ja 2 poistoa
  1. 6 1
      app/service/stage_pos.js
  2. 1 1
      app/service/tender.js

+ 6 - 1
app/service/stage_pos.js

@@ -59,7 +59,12 @@ module.exports = app => {
          * @returns {Promise<*>}
          */
         async getAuditorStageData(tid, sid, times, order, pid) {
-            let pidSql = pid ? (' And Pos.pid in (' + (pid instanceof Array ? pid.join(', ') : pid) + ')') : '';
+            let pidSql;
+            if (pid instanceof Array) {
+                pidSql = pid.length > 0 ? ' And Pos.pid in (' + pid.join(', ') + ')' : '';
+            } else {
+                pidSql = 'And Pos.pid = ' + pid.toString();
+            }
             const sql = 'SELECT * FROM ' + this.tableName + ' As Pos ' +
                 '  INNER JOIN ( ' +
                 '    SELECT MAX(`times`) As `times`, MAX(`order`) As `order`, `pid` From ' + this.tableName +

+ 1 - 1
app/service/tender.js

@@ -148,7 +148,7 @@ module.exports = app => {
                 }
 
                 // 获取合同支付模板 并添加到标段
-                result = await ctx.service.pay.addDefaultPayData(this.transaction);
+                result = await this.ctx.service.pay.addDefaultPayData(operate.insertId, this.transaction);
                 if (!result) {
                     throw '新增合同支付数据失败';
                 }