lrf 2 سال پیش
والد
کامیت
85ccb821d7
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      app/service/view/student.js

+ 2 - 1
app/service/view/student.js

@@ -12,11 +12,12 @@ class StudentService extends CrudService {
     this.lessonModel = this.ctx.model.Business.Lesson;
     this.lessonModel = this.ctx.model.Business.Lesson;
     this.lessonStudentModel = this.ctx.model.Business.LessonStudent;
     this.lessonStudentModel = this.ctx.model.Business.LessonStudent;
   }
   }
-  async lessonList({ student_id, school_id, skip = 0, limit = 0, ...otherQuery }) {
+  async lessonList({ student_id, school_id, skip = 0, limit = 0, is_pay, ...otherQuery }) {
     // 查出该学生的课表
     // 查出该学生的课表
     const query = {};
     const query = {};
     if (student_id)query.student_id = student_id;
     if (student_id)query.student_id = student_id;
     if (school_id) query.school_id = school_id;
     if (school_id) query.school_id = school_id;
+    if (is_pay) query.is_pay = is_pay;
     const lsList = await this.lessonStudentModel.find(query, { lesson_id: 1, is_pay: 1, is_try: 1, is_sign: 1 });
     const lsList = await this.lessonStudentModel.find(query, { lesson_id: 1, is_pay: 1, is_try: 1, is_sign: 1 });
     const lessonIds = lsList.map(i => i.lesson_id);
     const lessonIds = lsList.map(i => i.lesson_id);
     let data = await this.lessonModel.find({ _id: lessonIds, ...otherQuery }).skip(parseInt(skip)).limit(parseInt(limit));
     let data = await this.lessonModel.find({ _id: lessonIds, ...otherQuery }).skip(parseInt(skip)).limit(parseInt(limit));