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