lrf 2 năm trước cách đây
mục cha
commit
804e6200f8
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      app/service/business/lessonStudent.js

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

@@ -133,10 +133,15 @@ class LessonStudentService extends CrudService {
         time: moment().format('YYYY-MM-DD HH:mm:ss'),
         money: data.money,
       };
+      // 创建退回余额的账单
       await billModel.create(obj);
       const relation = await this.rssModel.findOne({ student_id, school_id: data.school_id });
       relation.money = _.get(relation, 'money', 0) + _.get(obj, 'money', 0);
+      // 退回至账户
       await relation.save();
+      data.is_pay = '-3';
+      // 学员退课
+      await data.save();
     }