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

fix course sort

parent 340101d8
Pipeline #14937 passed with stage
in 8 seconds
......@@ -429,7 +429,6 @@ class InstitutionService extends Service {
const sort = function(a, b) {
return a.distance - b.distance;
};
ret = R.sort(sort)(ret);
const institutions = [];
for (const v of ret) {
......@@ -438,13 +437,23 @@ class InstitutionService extends Service {
}
}
const results = [];
let results = [];
let debugs = [];
for (const v of institutions) {
if (!ctx.isEmpty(v)) {
results.push(v);
debugs.push(
{
id: v.id,
name: v.name,
distance: v.distance,
}
)
}
}
results = R.sort(sort)(results);
if (results.length <= (page - 1) * 10) {
return { count: 0, rows: [] };
}
......
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