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 { ...@@ -19,8 +19,8 @@ class OnlineService extends Service {
// 课程状态 // 课程状态
const mode = [{ id: 0, name: '全部' }, { id: 1, name: '直播' }, { id: 2, name: '录播' }, { id: 3, name: '直播+录播' }]; 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 }); // 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); // type = [{ id: 0, name: '全部' }].concat(type);
// 课程类型 // 课程类型
const price_type = [{ id: 0, name: '全部' }, { id: 2, name: '免费公益课' }, { id: 1, name: '低价体验课' }, { id: 3, name: '正价课' }]; const price_type = [{ id: 0, name: '全部' }, { id: 2, name: '免费公益课' }, { id: 1, name: '低价体验课' }, { id: 3, name: '正价课' }];
...@@ -88,6 +88,7 @@ class OnlineService extends Service { ...@@ -88,6 +88,7 @@ class OnlineService extends Service {
phone: ctx.isEmpty(area) ? '' : area.phone, phone: ctx.isEmpty(area) ? '' : area.phone,
travel_tips: ctx.isEmpty(area) ? '' : area.travel_tips, travel_tips: ctx.isEmpty(area) ? '' : area.travel_tips,
price: classInfo.price, price: classInfo.price,
price_type: this.getClassModelPriceType(classInfo.price_type),
type, type,
ages, ages,
mode: await this.getClassModelInfo(classInfo.mode), mode: await this.getClassModelInfo(classInfo.mode),
...@@ -109,7 +110,7 @@ class OnlineService extends Service { ...@@ -109,7 +110,7 @@ class OnlineService extends Service {
const limit = Number(input.limit) || 10; const limit = Number(input.limit) || 10;
const offset = (page - 1) * limit; const offset = (page - 1) * limit;
const { type, mode, age, cat, price_type } = input; 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 ids = [];
let flag = false; let flag = false;
...@@ -265,16 +266,16 @@ class OnlineService extends Service { ...@@ -265,16 +266,16 @@ class OnlineService extends Service {
ret = '低价体验课'; ret = '低价体验课';
break; break;
case 2: case 2:
ret = '公益免费课'; ret = '免费公益课';
break; break;
case 3: case 3:
ret = '正价课'; ret = '正价课';
break; break;
default: default:
break; break;
} }
return ret; return ret;
} }
// 收藏在线课程 // 收藏在线课程
async collectClass(id) { async collectClass(id) {
......
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