lrf 2 years ago
parent
commit
853d605463
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/service/business/lessonStudent.js

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

@@ -52,7 +52,7 @@ class LessonStudentService extends CrudService {
     if (data.is_pay === '1') throw new BusinessError(ErrorCode.SERVICE_FAULT, '该课程已支付成功');
     const payOrder = await this.payOrderModel.findById(data.pay_id);
     if (!payOrder) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到课程缴费信息');
-    const { openid, money, school_id, payer_id: student_id, from_id: lesson_id, order_no } = payOrder;
+    const { openid, money, school_id, payer_id: student_id, order_no } = payOrder;
     try {
       // 关闭订单
       await this.payService.close(order_no);
@@ -61,7 +61,7 @@ class LessonStudentService extends CrudService {
       this.tran.remove('PayOrder', data.pay_id);
       await this.tran.run();
       this.tran.clean();
-      const result = await this.create({ openid, money, school_id, student_id, lesson_id });
+      const result = await this.create({ openid, money, school_id, student_id, lesson_id: data.lesson_id });
       return result;
     } catch (error) {
       await this.tran.rollback();