Explorar o código

金额概况,期数问题

MaiXinRong %!s(int64=5) %!d(string=hai) anos
pai
achega
808f4b78e3
Modificáronse 1 ficheiros con 8 adicións e 3 borrados
  1. 8 3
      app/controller/tender_controller.js

+ 8 - 3
app/controller/tender_controller.js

@@ -48,9 +48,13 @@ module.exports = app => {
                     }
                     if (t.ledger_status === auditConst.ledger.status.checked) {
                         t.lastStage = await this.ctx.service.stage.getLastestStage(t.id, true);
-                        if (t.lastStage) {
-                            await this.ctx.service.stage.checkStageGatherData(t.lastStage);
-                        }
+
+                        if (!t.lastStage) continue;
+                        if (t.lastStage.status === auditConst.stage.status.uncheck && t.lastStage.user_id !== this.ctx.session.sessionUser.accountId)
+                            t.lastStage = await this.ctx.service.stage.getLastestStage(t.id);
+
+                        if (!t.lastStage) continue;
+                        await this.ctx.service.stage.checkStageGatherData(t.lastStage);
                     }
                 }
                 const categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
@@ -112,6 +116,7 @@ module.exports = app => {
                 renderData.pid = this.ctx.session.sessionProject.id;
                 await this.layout(view, renderData, modal);
             } catch (err) {
+                console.log('error', err);
                 this.log(err);
                 this.ctx.redirect('/dashboard')
             }