lrf 2 anni fa
parent
commit
b685d29907
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      app/service/business/payOrder.js

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

@@ -49,7 +49,6 @@ class PayOrderService extends CrudService {
    */
   async payCallBack({ result }) {
     const { out_trade_no, payer } = result;
-    console.log(result);
     // 没有需要报警,没有订单号就出问题了
     if (!out_trade_no) {
       console.error('没有支付订单号');
@@ -89,10 +88,11 @@ class PayOrderService extends CrudService {
           this.tran.update('RelationStudentSchool', rss._id, { money: newMoney });
         }
       }
-
       this.tran.insert('Bill', billData);
-
-
+      // 如果是上课,需要修改上课记录那边的支付状态
+      if (_.lowerFirst(billData.pay_for) === 'lessonStudent') {
+        this.tran.update('LessonStudent', payOrder.from_id, { is_pay: update.status });
+      }
       await this.tran.run();
     } catch (error) {
       await this.tran.rollback();