Commit 4f16dc31 authored by 任国军's avatar 任国军

fix teacher

parent fa812e82
Pipeline #14435 passed with stage
in 33 seconds
...@@ -6,7 +6,7 @@ class TestController extends Controller { ...@@ -6,7 +6,7 @@ class TestController extends Controller {
const { service, ctx } = this; const { service, ctx } = this;
const from = { lng: 120.069206, lat: 30.291121 }; const from = { lng: 120.069206, lat: 30.291121 };
const to = { lng: 120.212997, lat: 30.29133 }; const to = { lng: 120.212997, lat: 30.29133 };
const ret = await service.course.lbs.getLBSDistance('driving', from, [ to ]); const ret = await service.course.lbs.getLBSDistance('walking', from, [ to, to ]);
ctx.success(ret); ctx.success(ret);
} }
} }
......
...@@ -74,7 +74,7 @@ class InstitutionService extends Service { ...@@ -74,7 +74,7 @@ class InstitutionService extends Service {
const institution_images = await ctx.classModel.CourseImages.all({ where: { type: 1, type_id: institution_id } });//图片 const institution_images = await ctx.classModel.CourseImages.all({ where: { type: 1, type_id: institution_id } });//图片
//处理详情页信息 //处理详情页信息
const current_area = await ctx.classModel.CourseArea.one({ id: area_id }); const current_area = await ctx.classModel.CourseArea.one({ where:{id: area_id }});
let institution_detail = await this.formatInstitutions([institution]); let institution_detail = await this.formatInstitutions([institution]);
institution_detail = institution_detail[0]; institution_detail = institution_detail[0];
institution_detail.address = current_area.address; institution_detail.address = current_area.address;
...@@ -179,8 +179,8 @@ class InstitutionService extends Service { ...@@ -179,8 +179,8 @@ class InstitutionService extends Service {
const teachers = await ctx.classModel.CourseTeacher.list({ attributes, page, limit, where }); const teachers = await ctx.classModel.CourseTeacher.list({ attributes, page, limit, where });
const ret = []; const ret = [];
for (let i in teachers) { for (let i in teachers.rows) {
const teacher = teachers[i]; const teacher = teachers.rows[i];
ret.push({ ret.push({
id: teacher.id, id: teacher.id,
institution_id: teacher.institution_id, institution_id: teacher.institution_id,
......
...@@ -103,7 +103,7 @@ module.exports = appInfo => { ...@@ -103,7 +103,7 @@ module.exports = appInfo => {
// other sequelize configurations // other sequelize configurations
dialect: 'mysql', dialect: 'mysql',
host: 'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com', host: 'rm-bp1mnwmta5778y0d3jo.mysql.rds.aliyuncs.com',
database: 'class_dev', database: 'class_uat',
username: 'class_testing', username: 'class_testing',
password: 'WV862L32451I6KD58tU9K', password: 'WV862L32451I6KD58tU9K',
port: 3306, port: 3306,
......
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