Commit 189dc29c authored by 任国军's avatar 任国军

classList add word

parent 687ecb51
Pipeline #25749 passed with stage
in 5 seconds
...@@ -38,6 +38,13 @@ class InstitutionSubService extends Service { ...@@ -38,6 +38,13 @@ class InstitutionSubService extends Service {
if (!ctx.isEmpty(input.price_type)) { if (!ctx.isEmpty(input.price_type)) {
filter.where.price_type = input.price_type; filter.where.price_type = input.price_type;
} }
// 搜索
if (!ctx.isEmpty(input.word)) {
// 先查询机构名称的
const institutionList = await ctx.classModel.V5.CourseV5Institution.findAll({ where: { name: { $like: `%${input.word}%` }, status: 1, is_deleted: 0 }, attributes: [ 'id', 'name' ], raw: true });
const institutionIds = R.pluck('id', institutionList);
filter.where.$or = [{ name: { $like: `%${input.word}%` } }, { institution_id: { $in: institutionIds } }];
}
if (flag) { if (flag) {
filter.where.id = { $in: filterIds }; filter.where.id = { $in: filterIds };
} }
......
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