Commit 5fd0bd7f authored by 任国军's avatar 任国军

searchClass add order

parent 1b57bc03
Pipeline #25060 passed with stage
in 4 seconds
......@@ -396,7 +396,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' ], 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' ], order: [[ 'sort', 'asc' ]], raw: true });
classList = await this.formatClassList(classList);
const ret = {
......
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