lrf 2 anos atrás
pai
commit
9d777aa99e

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

@@ -113,6 +113,8 @@ class LessonStudentService extends CrudService {
           bill: billId,
           money,
         };
+        // 修改课程信息的支付状态
+        this.tran.update('LessonStudent', id, { is_pay: '1' });
       }
       const pay_id = this.tran.insert('PayOrder', payData);
       const result = { pay_id };

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

@@ -72,7 +72,7 @@ class PayOrderService extends CrudService {
       // 生成账单
       const billData = _.pick(payOrder, [ 'school_id', 'payer_id', 'payer_role', 'pay_for', 'from_id' ]);
       // 充值为1,直接支付为-1
-      if (billData.pay_for && _.lowerFirst(billData.pay_for) === 'charge') billData.type = '1';
+      if (billData.pay_for && billData.pay_for === 'Charge') billData.type = '1';
       else billData.type = '-1';
       billData.money = payOrder.money;
       billData.pay_id = payOrder._id;
@@ -90,7 +90,7 @@ class PayOrderService extends CrudService {
       }
       this.tran.insert('Bill', billData);
       // 如果是上课,需要修改上课记录那边的支付状态
-      if (_.lowerFirst(billData.pay_for) === 'lessonStudent') {
+      if (billData.pay_for === 'LessonStudent') {
         this.tran.update('LessonStudent', payOrder.from_id, { is_pay: update.status });
       }
       await this.tran.run();