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

fix recommendClassList empty bug

parent c45b6a7f
Pipeline #22506 passed with stage
in 11 seconds
...@@ -281,7 +281,7 @@ class ReportService extends Service { ...@@ -281,7 +281,7 @@ class ReportService extends Service {
// 按照分数降序,价格升序的顺序排列 // 按照分数降序,价格升序的顺序排列
classList = _.orderBy(classList, [ 'score', 'filter_price' ], [ 'desc', 'asc' ]); classList = _.orderBy(classList, [ 'score', 'filter_price' ], [ 'desc', 'asc' ]);
classList = classList.slice(0, 3); classList = ctx.isEmpty(classList) ? [] : classList.slice(0, 3);
for (let i = 0; i < classList.length; i++) { for (let i = 0; i < classList.length; i++) {
classList[i].match = 99 - i * 3 - Math.floor(Math.random() * 3); classList[i].match = 99 - i * 3 - Math.floor(Math.random() * 3);
......
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