Commit fa812e82 authored by 任国军's avatar 任国军

fix distance sort

parent 3d8a2a75
Pipeline #14434 passed with stage
in 6 seconds
...@@ -163,7 +163,7 @@ class InstitutionService extends Service { ...@@ -163,7 +163,7 @@ class InstitutionService extends Service {
const { ctx } = this; const { ctx } = this;
const where = { id: class_id }; const where = { id: class_id };
let classs = await ctx.classModel.CourseClass.one({ where }); let classs = await ctx.classModel.CourseClass.one({ where });
classs.dataValues.age_text = `${classs.min_age}-${classs.max_age}岁`; classs.dataValues.age_text = Number(classs.max_age) > 0 ? `${classs.min_age}-${classs.max_age}岁` : '';
classs.dataValues.point_tags = classs.point ? classs.point.split(';') : []; classs.dataValues.point_tags = classs.point ? classs.point.split(';') : [];
classs.dataValues.photo_album = classs.image ? classs.image.split(';') : []; classs.dataValues.photo_album = classs.image ? classs.image.split(';') : [];
...@@ -375,7 +375,7 @@ class InstitutionService extends Service { ...@@ -375,7 +375,7 @@ class InstitutionService extends Service {
// area.duration = duration; // area.duration = duration;
// area.travel_tips = travel_tips; // area.travel_tips = travel_tips;
institution_area.distance = Number(distance) === 0 ? 999999999 : distance; institution_area.distance = Number(distance) === 0 ? 999999999.0 : parseFloat(distance);
institution_area.duration = duration; institution_area.duration = duration;
institution_area.travel_tips = travel_tips; institution_area.travel_tips = travel_tips;
......
...@@ -58,7 +58,7 @@ class OptionService extends Service { ...@@ -58,7 +58,7 @@ class OptionService extends Service {
newNode.level = node.level; newNode.level = node.level;
newNode.value = node.id; newNode.value = node.id;
newNode._child = this.getTrees(data, node.id); newNode._child = this.getTrees(data, node.id);
if (newNode._child.length !== 0) newNode._child.unshift({ id: 0, name: '全部', value: 0 }); if (newNode._child.length !== 0) newNode._child.unshift({ id: 0, name: '全部', value: node.id });
ret.push(newNode); ret.push(newNode);
} }
} }
......
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