lrf 2 年之前
父節點
當前提交
45a1700a1e
共有 1 個文件被更改,包括 2 次插入2 次删除
  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) {