Commit ffa84612 authored by 李尚科's avatar 李尚科

course institution fix

parent a0453825
Pipeline #15117 passed with stage
in 58 seconds
...@@ -34,7 +34,8 @@ class InstitutionService extends Service { ...@@ -34,7 +34,8 @@ class InstitutionService extends Service {
let cat_ids = [ cat_id ]; let cat_ids = [ cat_id ];
cat_ids = cat_ids.concat(R.pluck('id', next_cat)).concat(R.pluck('id', next_next_cat)); cat_ids = cat_ids.concat(R.pluck('id', next_cat)).concat(R.pluck('id', next_next_cat));
const institutions = await ctx.classModel.CourseInstitutionToCat.all({ where: { cat_id: { $in: cat_ids } } }); const institutions = await ctx.classModel.CourseInstitutionToCat.all({ where: { cat_id: { $in: cat_ids } } });
where.id = { $in: R.pluck('institution_id', institutions) }; const institutions_ids = Array.from(new Set(R.pluck('institution_id', institutions)));
institutions_ids.length !== 0 ? where.id = { $in: institutions_ids } : [];
} }
if (Number(ages)) { if (Number(ages)) {
where.max_age = { $gte: ages }; where.max_age = { $gte: ages };
......
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