lrf 2 years ago
parent
commit
df87ded64a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/service/business/payOrder.js

+ 2 - 2
app/service/business/payOrder.js

@@ -26,7 +26,7 @@ class PayOrderService extends CrudService {
   async beforeCreate(data) {
     if (!_.get(data, 'order_no')) data.order_no = this.getOrderNo();
     const { data: nd, next } = await this.checkSurplus(data);
-    if (!next) throw new BusinessError(0, '扣除余额成功');
+    if (!next) throw new BusinessError(0, '扣除余额成功', nd);
     data = nd;
     return data;
   }
@@ -65,7 +65,7 @@ class PayOrderService extends CrudService {
         relation.money = surplus - money;
         await relation.save();
         // 前端生成报名数据
-        return { data, next: false };
+        return { data: billData, next: false };
       } catch (error) {
         // 抓取数据库创建和修改的异常,
         // 如果 billData没有值,说明是创建消费记录时发生的错误,不需要做回滚处理;如果有值,那就删除