Browse Source

合同支付相关

MaiXinRong 1 year ago
parent
commit
a35f5da338
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/service/stage_pay.js

+ 2 - 2
app/service/stage_pay.js

@@ -103,6 +103,7 @@ module.exports = app => {
                 const prePays = await this.getStageLastestPays(preStage);
                 for (const pp of prePays) {
                     const p = this._.find(pays, {id: pp.pid});
+                    if (!p.valid) continue;
                     stagePays.push({
                         tid: p.tid, sid: stage.id, pid: p.id,
                         stimes: stage.times, sorder: 0,
@@ -497,8 +498,7 @@ module.exports = app => {
         }
 
         async cacheOrder(stage, transaction) {
-            //const sql = `UPDATE ${this.tableName} sp LEFT JOIN ${this.ctx.service.pay.tableName} p ON sp.pid = p.id SET sp.porder = p.\`order\` Where sp.sid = ? AND p.valid`;
-            const sql = `UPDATE ${this.tableName} sp LEFT JOIN ${this.ctx.service.pay.tableName} p ON sp.pid = p.id SET sp.porder = p.\`order\` Where sp.sid = ?`;
+            const sql = `UPDATE ${this.tableName} sp LEFT JOIN ${this.ctx.service.pay.tableName} p ON sp.pid = p.id SET sp.porder = p.\`order\` Where sp.sid = ? AND p.valid`;
             await transaction.query(sql, [stage.id]);
         }
     }