|
@@ -12,11 +12,12 @@ class StudentService extends CrudService {
|
|
|
this.lessonModel = this.ctx.model.Business.Lesson;
|
|
|
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 = {};
|
|
|
if (student_id)query.student_id = student_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 lessonIds = lsList.map(i => i.lesson_id);
|
|
|
let data = await this.lessonModel.find({ _id: lessonIds, ...otherQuery }).skip(parseInt(skip)).limit(parseInt(limit));
|