Commit 09cd970f authored by 任国军's avatar 任国军

fix comments bug

parent 0c69d658
Pipeline #16480 passed with stage
in 9 seconds
...@@ -486,7 +486,7 @@ class InstitutionSubService extends Service { ...@@ -486,7 +486,7 @@ class InstitutionSubService extends Service {
} }
const ids = R.pluck('id', comments); const ids = R.pluck('id', comments);
const images = await ctx.classModel.CourseImages.findALl({ where: { type: 3, type_id: { $in: ids }, status: 'online', is_deleted: 0 } }); const images = await ctx.classModel.CourseImages.findAll({ where: { type: 3, type_id: { $in: ids }, status: 'online', is_deleted: 0 } });
const ret = []; const ret = [];
for (const v of comments) { for (const v of comments) {
...@@ -533,6 +533,33 @@ class InstitutionSubService extends Service { ...@@ -533,6 +533,33 @@ class InstitutionSubService extends Service {
return ret; return ret;
} }
// 教师详情
async getTeacher(id) {
const { ctx } = this;
let teacher = await ctx.classModel.CourseTeacher.findOne({ where: { id, status: 'online', is_deleted: 0 } });
if (ctx.isEmpty(teacher)) {
ctx.failed('数据不存在');
}
teacher = teacher.dataValues;
teacher.point_tags = teacher.point ? teacher.point.split(',') : [];
teacher.work_experience_tags = teacher.work_experience ? teacher.work_experience.split(';') : [];
const institution = await ctx.classModel.CourseInstitution.findOne({ where: { id: teacher.institution_id } });
teacher.institution_name = institution.name;
return teacher;
}
// 教师列表
async getTeachers(input) {
const { ctx } = this;
const page = Number(input.page) || 1;
}
} }
module.exports = InstitutionSubService; module.exports = InstitutionSubService;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment