Commit 9c613651 authored by 谢永靖's avatar 谢永靖

排序

parent 1ea9ab4a
Pipeline #38718 passed with stage
in 9 seconds
...@@ -8,10 +8,10 @@ class ProductNewService extends Service { ...@@ -8,10 +8,10 @@ class ProductNewService extends Service {
const user_id = ctx.userId; const user_id = ctx.userId;
const app_user_id = ctx.appUserId; const app_user_id = ctx.appUserId;
const recommendSort = function(a, b) { const recommendSort = function(a, b) {
if (a.recommend_sorter === b.recommend_sorter) { if (a.sort === b.sort) {
return b.business_id - a.business_id; return b.business_id - a.business_id;
} }
return a.recommend_sorter - b.recommend_sorter; return a.sort - b.sort;
}; };
const credit_loans = await ctx.service.gjj.product.getAllProductsByType(1); const credit_loans = await ctx.service.gjj.product.getAllProductsByType(1);
const common_loans = await ctx.service.gjj.product.getAllProductsByType(4); const common_loans = await ctx.service.gjj.product.getAllProductsByType(4);
...@@ -78,10 +78,10 @@ class ProductNewService extends Service { ...@@ -78,10 +78,10 @@ class ProductNewService extends Service {
async getLoanHomeList() { async getLoanHomeList() {
const { ctx } = this; const { ctx } = this;
const recommendSort = function(a, b) { const recommendSort = function(a, b) {
if (a.recommend_sorter === b.recommend_sorter) { if (a.sort === b.sort) {
return b.business_id - a.business_id; return b.business_id - a.business_id;
} }
return a.recommend_sorter - b.recommend_sorter; return a.sort - b.sort;
}; };
const credit_loans = await ctx.service.gjj.product.getAllProductsByType(1); const credit_loans = await ctx.service.gjj.product.getAllProductsByType(1);
const common_loans = await ctx.service.gjj.product.getAllProductsByType(4); const common_loans = await ctx.service.gjj.product.getAllProductsByType(4);
......
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