Commit 33d00258 authored by 任国军's avatar 任国军

add cover_image

parent 92903787
Pipeline #16873 passed with stage
in 53 seconds
...@@ -18,6 +18,7 @@ module.exports = app => { ...@@ -18,6 +18,7 @@ module.exports = app => {
age: STRING, age: STRING,
time: STRING, time: STRING,
sort: INTEGER, sort: INTEGER,
cover_image: STRING,
status: ENUM('offline', 'online'), status: ENUM('offline', 'online'),
is_deleted: INTEGER, is_deleted: INTEGER,
created_time: { created_time: {
......
...@@ -169,6 +169,7 @@ class InstitutionSubService extends Service { ...@@ -169,6 +169,7 @@ class InstitutionSubService extends Service {
// 暂定3公里以内步行 // 暂定3公里以内步行
area.travel_method = distance < 3000 ? 'walking' : 'driving'; area.travel_method = distance < 3000 ? 'walking' : 'driving';
const lbsResult = await service.course.v2.lbs.getLBSDistance(area.travel_method, { lng: location.lng, lat: location.lat }, [{ lng: area.lng, lat: area.lat }]); const lbsResult = await service.course.v2.lbs.getLBSDistance(area.travel_method, { lng: location.lng, lat: location.lat }, [{ lng: area.lng, lat: area.lat }]);
console.log(lbsResult);
if (lbsResult.results.length > 0) { if (lbsResult.results.length > 0) {
area.distance = (lbsResult.results[0].distance / 1000).toFixed(1); area.distance = (lbsResult.results[0].distance / 1000).toFixed(1);
area.duration = lbsResult.results[0].duration; area.duration = lbsResult.results[0].duration;
...@@ -571,22 +572,6 @@ class InstitutionSubService extends Service { ...@@ -571,22 +572,6 @@ class InstitutionSubService extends Service {
} }
// 教师详情
async getTeacher(id) {
const { ctx } = this;
const teacher = await ctx.classModel.V2.CourseTeacher.findOne({ where: { id, status: 'online', is_deleted: 0 }, raw: true });
if (ctx.isEmpty(teacher)) {
ctx.failed('数据不存在');
}
teacher.point_tags = teacher.point ? teacher.point.split(',') : [];
teacher.work_experience_tags = teacher.work_experience ? teacher.work_experience.split(';') : [];
const institution = await ctx.classModel.V2.CourseInstitution.findOne({ where: { id: teacher.institution_id } });
teacher.institution_name = institution.name;
return teacher;
}
// 课程列表 // 课程列表
async getClasses(input) { async getClasses(input) {
const { ctx } = this; const { ctx } = this;
......
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