瀏覽代碼

删除期,刷新缓存相关

MaiXinRong 1 年之前
父節點
當前提交
d600dcc2d2
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      app/service/stage_audit.js
  2. 2 2
      app/service/tender_cache.js

+ 1 - 1
app/service/stage_audit.js

@@ -99,7 +99,7 @@ module.exports = app => {
             const sqlParam = [stageId, status, times ? times: 1];
             const sqlParam = [stageId, status, times ? times: 1];
             const result = await this.db.query(sql, sqlParam);
             const result = await this.db.query(sql, sqlParam);
             if (result.length === 0) return [];
             if (result.length === 0) return [];
-            return result.filter(x => { x.order === result[result.length - 1].order });
+            return result.filter(x => { return x.order === result[0].order });
         }
         }
 
 
         /**
         /**

+ 2 - 2
app/service/tender_cache.js

@@ -170,10 +170,10 @@ module.exports = app => {
                     pre_yf_tp: preStage.pre_yf_tp, pre_sf_tp: preStage.pre_sf_tp,
                     pre_yf_tp: preStage.pre_yf_tp, pre_sf_tp: preStage.pre_sf_tp,
                 });
                 });
                 const auditors = await this.ctx.service.stageAudit.getLastestAuditors(preStage.id, preStage.times, preStage.status);
                 const auditors = await this.ctx.service.stageAudit.getLastestAuditors(preStage.id, preStage.times, preStage.status);
-                const user_info = JSON.stringify(auditors.map(auditor => { return {
+                const user_info = auditors.length > 0 ? JSON.stringify(auditors.map(auditor => { return {
                     order: preStage.order, status: preStage.status, time: auditor.end_time, audit_order: auditor.audit_order,
                     order: preStage.order, status: preStage.status, time: auditor.end_time, audit_order: auditor.audit_order,
                     name: auditor.name, company: auditor.company, role: auditor.role, mobile: auditor.mobile, telephone: auditor.telephone,
                     name: auditor.name, company: auditor.company, role: auditor.role, mobile: auditor.mobile, telephone: auditor.telephone,
-                }}));
+                }})) : '';
                 await transaction.update(this.tableName, {
                 await transaction.update(this.tableName, {
                     id: delStage.tid, stage_count: preStage.order, stage_complete_count: preStage.order, stage_status: preStage.status,
                     id: delStage.tid, stage_count: preStage.order, stage_complete_count: preStage.order, stage_status: preStage.status,
                     stage_flow_cur_uid: 0, stage_flow_cur_info: '', stage_flow_cur_tp: '',
                     stage_flow_cur_uid: 0, stage_flow_cur_info: '', stage_flow_cur_tp: '',