lrf %!s(int64=2) %!d(string=hai) anos
pai
achega
2946611c64
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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();
 
   }