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
d8779ce0
Commit
d8779ce0
authored
Dec 04, 2019
by
任国军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix city_state bug
parent
dedfeb5c
Pipeline
#17855
passed with stage
in 53 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
21 deletions
+8
-21
product.js
app/service/gjj/product.js
+8
-21
No files found.
app/service/gjj/product.js
View file @
d8779ce0
...
@@ -135,7 +135,6 @@ class ProductService extends Service {
...
@@ -135,7 +135,6 @@ class ProductService extends Service {
const
products_results
=
await
ctx
.
helper
.
send_request
(
url
,
{
type
,
app_id
:
ctx
.
appId
},
{
method
:
'GET'
});
const
products_results
=
await
ctx
.
helper
.
send_request
(
url
,
{
type
,
app_id
:
ctx
.
appId
},
{
method
:
'GET'
});
// ctx.logger.info(JSON.stringify({ url, products_results }));
// ctx.logger.info(JSON.stringify({ url, products_results }));
let
products
=
[];
let
products
=
[];
console
.
log
(
products_results
);
if
(
products_results
.
status
!==
200
||
!
products_results
.
data
||
!
products_results
.
data
.
ret
)
{
if
(
products_results
.
status
!==
200
||
!
products_results
.
data
||
!
products_results
.
data
.
ret
)
{
return
products
;
return
products
;
}
}
...
@@ -207,15 +206,8 @@ class ProductService extends Service {
...
@@ -207,15 +206,8 @@ class ProductService extends Service {
// 获取普通贷款
// 获取普通贷款
async
getCommonBusinessList
()
{
async
getCommonBusinessList
()
{
const
{
ctx
}
=
this
;
const
ret
=
await
this
.
getAllProductsByType
(
4
);
const
url
=
ctx
.
app
.
config
.
NODE_BASE_URL
+
'/cassandra-server/bu_basic/list'
;
return
ret
;
const
param
=
{
type
:
4
,
app_id
:
ctx
.
appId
};
const
resp
=
await
ctx
.
helper
.
send_request
(
url
,
param
,
{
method
:
'GET'
});
if
(
resp
.
status
!==
200
)
{
ctx
.
failed
(
'[bu_basic]内部接口错误'
);
}
return
resp
.
data
.
ret
;
}
}
// 获取推荐列表,按照ABC分组顺序推荐
// 获取推荐列表,按照ABC分组顺序推荐
...
@@ -485,11 +477,11 @@ class ProductService extends Service {
...
@@ -485,11 +477,11 @@ class ProductService extends Service {
if
(
city_res
&&
city_res
.
content
&&
city_res
.
content
.
address_detail
&&
city_res
.
content
.
address_detail
.
city
)
{
if
(
city_res
&&
city_res
.
content
&&
city_res
.
content
.
address_detail
&&
city_res
.
content
.
address_detail
.
city
)
{
city
=
city_res
.
content
.
address_detail
.
city
.
replace
(
'市'
,
''
);
city
=
city_res
.
content
.
address_detail
.
city
.
replace
(
'市'
,
''
);
}
}
ctx
.
logger
.
info
(
city_res
);
ctx
.
logger
.
info
(
JSON
.
stringify
(
city_res
)
);
}
}
ctx
.
logger
.
info
(
'check loan city:'
+
city
);
for
(
const
v
of
products
)
{
for
(
const
v
of
products
)
{
ctx
.
logger
.
info
(
'imh------begin----------'
);
if
(
Number
(
v
.
type
)
===
2
||
Number
(
v
.
type
)
===
3
)
{
if
(
Number
(
v
.
type
)
===
2
||
Number
(
v
.
type
)
===
3
)
{
v
.
rate
=
''
;
v
.
rate
=
''
;
v
.
rate_title
=
''
;
v
.
rate_title
=
''
;
...
@@ -504,12 +496,10 @@ class ProductService extends Service {
...
@@ -504,12 +496,10 @@ class ProductService extends Service {
url
=
url
.
includes
(
'?'
)
?
url
+
'&from=51gjj_loan_channel'
:
url
+
'?from=51gjj_loan_channel'
;
url
=
url
.
includes
(
'?'
)
?
url
+
'&from=51gjj_loan_channel'
:
url
+
'?from=51gjj_loan_channel'
;
}
}
url
=
this
.
config
.
PHP_URL
+
'/app/track/url?url='
+
encodeURIComponent
(
url
)
+
'&source=51gjj&location='
+
location
;
url
=
this
.
config
.
PHP_URL
+
'/app/track/url?url='
+
encodeURIComponent
(
url
)
+
'&source=51gjj&location='
+
location
;
ctx
.
logger
.
info
(
v
.
cities
);
ctx
.
logger
.
info
(
city
);
if
(
v
.
cities
&&
v
.
cities
.
length
>
0
&&
city
!=
''
)
{
if
(
v
.
cities
&&
v
.
cities
.
length
>
0
&&
city
!=
''
)
{
ctx
.
logger
.
info
(
'imh------222----------'
);
ctx
.
logger
.
info
(
v
.
business_id
,
v
.
type
);
if
((
v
.
cities
.
includes
(
city
)
&&
Number
(
v
.
city_status
)
===
1
)
||
(
!
v
.
cities
.
includes
(
city
)
&&
Number
(
v
.
city_status
)
===
0
)
)
{
ctx
.
logger
.
info
(
JSON
.
stringify
(
v
.
cities
));
ctx
.
logger
.
info
(
'imh----------------'
);
if
((
v
.
cities
.
includes
(
city
)
&&
Number
(
v
.
city_state
)
===
1
)
||
(
!
v
.
cities
.
includes
(
city
)
&&
Number
(
v
.
city_state
)
===
0
)
)
{
const
tmp
=
{
const
tmp
=
{
type
:
v
.
type
,
type
:
v
.
type
,
business_id
:
v
.
business_id
,
business_id
:
v
.
business_id
,
...
@@ -554,11 +544,8 @@ class ProductService extends Service {
...
@@ -554,11 +544,8 @@ class ProductService extends Service {
};
};
ret
.
push
(
tmp
);
ret
.
push
(
tmp
);
}
}
ctx
.
logger
.
info
(
'imh------end----------'
);
}
}
ctx
.
logger
.
info
(
'check city end'
);
return
ret
;
return
ret
;
}
}
...
...
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