Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
522573a9
Commit
522573a9
authored
Jul 29, 2019
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add loan sort
parent
68e33aa7
Pipeline
#11636
passed with stage
in 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
product.js
app/service/gjj/product.js
+5
-2
No files found.
app/service/gjj/product.js
View file @
522573a9
...
@@ -73,7 +73,7 @@ class ProductService extends Service {
...
@@ -73,7 +73,7 @@ class ProductService 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
)
{
return
a
.
recommend_sorter
-
b
.
recommend_sorter
;
return
Number
(
a
.
recommend_sorter
)
-
Number
(
b
.
recommend_sorter
)
;
};
};
const
credit_loans
=
R
.
sort
(
recommendSort
)(
await
this
.
getAllProductsByType
(
1
));
const
credit_loans
=
R
.
sort
(
recommendSort
)(
await
this
.
getAllProductsByType
(
1
));
const
common_loans
=
R
.
sort
(
recommendSort
)(
await
this
.
getAllProductsByType
(
4
));
const
common_loans
=
R
.
sort
(
recommendSort
)(
await
this
.
getAllProductsByType
(
4
));
...
@@ -219,7 +219,7 @@ class ProductService extends Service {
...
@@ -219,7 +219,7 @@ class ProductService extends Service {
const
userId
=
ctx
.
userId
;
const
userId
=
ctx
.
userId
;
const
R
=
require
(
'ramda'
);
const
R
=
require
(
'ramda'
);
const
recommendSort
=
function
(
a
,
b
)
{
const
recommendSort
=
function
(
a
,
b
)
{
return
a
.
recommend_sorter
-
b
.
recommend_sorter
;
return
Number
(
a
.
recommend_sorter
)
-
Number
(
b
.
recommend_sorter
)
;
};
};
let
ret
=
[];
let
ret
=
[];
// 如果未登录,则推荐授信贷
// 如果未登录,则推荐授信贷
...
@@ -344,6 +344,9 @@ class ProductService extends Service {
...
@@ -344,6 +344,9 @@ class ProductService extends Service {
}
}
// 根据通过率降序排序
// 根据通过率降序排序
const
passRateSort
=
function
(
a
,
b
)
{
const
passRateSort
=
function
(
a
,
b
)
{
if
(
a
.
pass_rate
===
b
.
pass_rate
)
{
return
Number
(
a
.
recommend_sorter
)
-
Number
(
b
.
recommend_sorter
);
}
return
b
.
pass_rate
-
a
.
pass_rate
;
return
b
.
pass_rate
-
a
.
pass_rate
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment