asd123a20 3 years ago
parent
commit
e334f698a8
2 changed files with 4 additions and 4 deletions
  1. 2 2
      app/controller/order.js
  2. 2 2
      app/service/order.js

+ 2 - 2
app/controller/order.js

@@ -10,8 +10,8 @@ class ItemsController extends Controller {
     this.service = this.ctx.service.order;
   }
   async updatestatus() {
-    const { out_trade_no } = this.ctx.request.body;
-    const res = await this.service.updatestatus({ out_trade_no });
+    const { out_trade_no, status } = this.ctx.request.body;
+    const res = await this.service.updatestatus({ out_trade_no, status });
     this.ctx.ok(res);
   }
 }

+ 2 - 2
app/service/order.js

@@ -24,9 +24,9 @@ class OrderService extends CrudService {
     const res = await this.model.create({ name, phone, openid, time, code, hospitalId, hospitalName, subjectId, subjectName, status, remark, out_trade_no, code1 });
     return res;
   }
-  async updatestatus({ out_trade_no }) {
+  async updatestatus({ out_trade_no, status }) {
     assert(out_trade_no, '缺少参数out_trade_no');
-    const res = await this.model.findOne({ out_trade_no }).updateOne({ status: '1' });
+    const res = await this.model.findOne({ out_trade_no }).updateOne({ status });
     return res;
   }
 }