Commit f204f1de authored by 周楠's avatar 周楠

fix: price_type

parent ae4db6c7
Pipeline #19798 passed with stage
in 1 minute 8 seconds
......@@ -19,8 +19,8 @@ class OnlineService extends Service {
// 课程状态
const mode = [{ id: 0, name: '全部' }, { id: 1, name: '直播' }, { id: 2, name: '录播' }, { id: 3, name: '直播+录播' }];
// 课程班型
let type = await ctx.classModel.V4.CourseOnlineType.findAll({ where: { status: 'online', is_deleted: 0 }, attributes: [ 'id', 'name' ], raw: true });
type = [{ id: 0, name: '全部' }].concat(type);
// let type = await ctx.classModel.V4.CourseOnlineType.findAll({ where: { status: 'online', is_deleted: 0 }, attributes: [ 'id', 'name' ], raw: true });
// type = [{ id: 0, name: '全部' }].concat(type);
// 课程类型
const price_type = [{ id: 0, name: '全部' }, { id: 2, name: '免费公益课' }, { id: 1, name: '低价体验课' }, { id: 3, name: '正价课' }];
......@@ -88,6 +88,7 @@ class OnlineService extends Service {
phone: ctx.isEmpty(area) ? '' : area.phone,
travel_tips: ctx.isEmpty(area) ? '' : area.travel_tips,
price: classInfo.price,
price_type: this.getClassModelPriceType(classInfo.price_type),
type,
ages,
mode: await this.getClassModelInfo(classInfo.mode),
......@@ -109,7 +110,7 @@ class OnlineService extends Service {
const limit = Number(input.limit) || 10;
const offset = (page - 1) * limit;
const { type, mode, age, cat, price_type } = input;
const filter = { where: { status: 'online', is_deleted: 0 }, order: [[ 'institution_id', 'desc' ]], limit, offset, attributes: [ 'id', 'institution_id', 'name', 'price', 'mode', 'time', 'created_time' ] };
const filter = { where: { status: 'online', is_deleted: 0 }, order: [[ 'institution_id', 'desc' ]], limit, offset, attributes: [ 'id', 'institution_id', 'name', 'price_type', 'price', 'mode', 'time', 'created_time' ] };
// 年龄段筛选
let ids = [];
let flag = false;
......@@ -265,7 +266,7 @@ class OnlineService extends Service {
ret = '低价体验课';
break;
case 2:
ret = '公益免费课';
ret = '免费公益课';
break;
case 3:
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