lrf 2 years ago
parent
commit
45a1700a1e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/service/trade/pay.js

+ 2 - 2
app/service/trade/pay.js

@@ -112,10 +112,10 @@ class PayService extends CrudService {
     try {
     try {
       this.tran.update('Order', orderData._id, { pay: payData, status: '1' });
       this.tran.update('Order', orderData._id, { pay: payData, status: '1' });
       await this.tran.run();
       await this.tran.run();
-      // 加积分
-      await this.ctx.service.user.point.afterPayOrder({ order_id: orderData._id, openid }, this.tran);
       // 拆订单
       // 拆订单
       await this.ctx.service.trade.orderDetail.create({ order_id: orderData._id }, this.tran);
       await this.ctx.service.trade.orderDetail.create({ order_id: orderData._id }, this.tran);
+      // 加积分
+      await this.ctx.service.user.point.afterPayOrder({ order_id: orderData._id, openid }, this.tran);
       console.log(this.tran.getOperations());
       console.log(this.tran.getOperations());
       await this.tran.run();
       await this.tran.run();
     } catch (error) {
     } catch (error) {