lrf 2 лет назад
Родитель
Сommit
2946611c64
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      app/service/business/lessonStudent.js

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

@@ -112,7 +112,7 @@ class LessonStudentService extends CrudService {
     const { payer_role, payer_id, school_id } = payOrder;
     if (payer_role === 'Student') relation = await this.rssModel.findOne({ student_id: payer_id, school_id });
     else if (payer_role === 'Coach') relation = await this.rcsModel.findOne({ coach_id: payer_id, school_id });
-    relation.money = relation.money + obj.money;
+    relation.money = _.get(relation, 'money', 0) + _.get(obj, 'money', 0);
     await relation.save();
 
   }