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 { ...@@ -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 classAll = await ctx.classModel.V5.CourseV5ClassToCat.findAll({ where: { cat_id, status: 1, is_deleted: 0 } });
const classIds = R.pluck('class_id', classAll); const classIds = R.pluck('class_id', classAll);
// 体验课
// 精品课 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); classList = await this.formatClassList(classList);
for (const i in classList) { for (const i in classList) {
classList[i].institution_icon = ''; classList[i].institution_icon = '';
} }
results.push({ results.push({
title: '精品课', title: '免费课',
value: 3, value: 1,
class: classList, class: classList,
}); });
...@@ -567,15 +566,15 @@ class InstitutionSubService extends Service { ...@@ -567,15 +566,15 @@ class InstitutionSubService extends Service {
class: classList, 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); classList = await this.formatClassList(classList);
for (const i in classList) { for (const i in classList) {
classList[i].institution_icon = ''; classList[i].institution_icon = '';
} }
results.push({ results.push({
title: '免费课', title: '精品课',
value: 1, value: 3,
class: classList, 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