lrf hace 2 años
padre
commit
45a1700a1e
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      app/service/trade/pay.js

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

@@ -112,10 +112,10 @@ class PayService extends CrudService {
     try {
       this.tran.update('Order', orderData._id, { pay: payData, status: '1' });
       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.user.point.afterPayOrder({ order_id: orderData._id, openid }, this.tran);
       console.log(this.tran.getOperations());
       await this.tran.run();
     } catch (error) {