Commit b23f103c authored by 任国军's avatar 任国军

change home classList sort

parent c0cb0111
Pipeline #27076 passed with stage
in 4 seconds
......@@ -542,16 +542,15 @@ class InstitutionSubService extends Service {
const classAll = await ctx.classModel.V5.CourseV5ClassToCat.findAll({ where: { cat_id, status: 1, is_deleted: 0 } });
const classIds = R.pluck('class_id', classAll);
// 精品课
classList = await ctx.classModel.V5.CourseV5Class.findAll({ where: { id: { $in: classIds }, price_type: 3, status: 1, is_deleted: 0 }, attributes, order: [[ 'sort', 'asc' ], [ 'id', 'desc' ]], offset: 0, limit: 6, raw: true });
// 体验课
classList = await ctx.classModel.V5.CourseV5Class.findAll({ where: { id: { $in: classIds }, price_type: 1, status: 1, is_deleted: 0 }, attributes, order: [[ 'sort', 'asc' ], [ 'id', 'desc' ]], offset: 0, limit: 6, raw: true });
classList = await this.formatClassList(classList);
for (const i in classList) {
classList[i].institution_icon = '';
}
results.push({
title: '精品课',
value: 3,
title: '免费课',
value: 1,
class: classList,
});
......@@ -567,15 +566,15 @@ class InstitutionSubService extends Service {
class: classList,
});
// 体验
classList = await ctx.classModel.V5.CourseV5Class.findAll({ where: { id: { $in: classIds }, price_type: 1, status: 1, is_deleted: 0 }, attributes, order: [[ 'sort', 'asc' ], [ 'id', 'desc' ]], offset: 0, limit: 6, raw: true });
// 精品
classList = await ctx.classModel.V5.CourseV5Class.findAll({ where: { id: { $in: classIds }, price_type: 3, status: 1, is_deleted: 0 }, attributes, order: [[ 'sort', 'asc' ], [ 'id', 'desc' ]], offset: 0, limit: 6, raw: true });
classList = await this.formatClassList(classList);
for (const i in classList) {
classList[i].institution_icon = '';
}
results.push({
title: '免费课',
value: 1,
title: '精品课',
value: 3,
class: classList,
});
......
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