Commit 0af237e9 authored by 任国军's avatar 任国军

fix search response & option_age

parent ff485a56
......@@ -454,7 +454,7 @@ class InstitutionSubService extends Service {
// 先查询机构名称的
const institutionList = await ctx.classModel.V5.CourseV5Institution.findAll({ where: { name: { $like: `%${word}%` }, status: 1, is_deleted: 0 }, attributes: [ 'id', 'name' ], raw: true });
const institutionIds = R.pluck('id', institutionList);
let classList = await ctx.classModel.V5.CourseV5Class.findAll({ where: { $or: [{ name: { $like: `%${word}%` } }, { institution_id: { $in: institutionIds } }], status: 1, is_deleted: 0 }, attributes: [ 'id', 'name', 'logo', 'price_type', 'mode', 'price', 'age', 'institution_id', 'pay_count' ], order: [[ 'sort', 'asc' ]], raw: true });
let classList = await ctx.classModel.V5.CourseV5Class.findAll({ where: { $or: [{ name: { $like: `%${word}%` } }, { institution_id: { $in: institutionIds } }], status: 1, is_deleted: 0 }, attributes: [ 'id', 'name', 'logo', 'price_type', 'mode', 'price', 'age', 'institution_id', 'pay_count', 'multi_classes', 'sub_title' ], order: [[ 'sort', 'asc' ]], raw: true });
classList = await this.formatClassList(classList);
const ret = {
......
......@@ -68,7 +68,7 @@ class OptionService extends Service {
ageList.forEach(e => {
e.value = e.id;
});
ageList.unshift({ id: 0, name: '全', value: 0 });
ageList.unshift({ id: 0, name: '全年级', value: 0 });
// // 课程班型
// const typeList = await ctx.classModel.V5.CourseV5Type.findAll({ where: { status: 1, is_deleted: 0 }, order: [ ['sort', 'asc'] ], attributes: [ 'id', 'name' ], raw: true });
// typeList.forEach(e => {
......
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