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
718ae495
Commit
718ae495
authored
Dec 05, 2019
by
方斌
Browse files
Options
Browse Files
Download
Plain Diff
z
parents
547d357e
d8779ce0
Pipeline
#17869
passed with stage
in 7 seconds
Changes
3
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
84 deletions
+90
-84
wechat.js
app/controller/gjj/wechat.js
+71
-53
product.js
app/service/gjj/product.js
+17
-29
config.local.js
config/config.local.js
+2
-2
No files found.
app/controller/gjj/wechat.js
View file @
718ae495
This diff is collapsed.
Click to expand it.
app/service/gjj/product.js
View file @
718ae495
...
@@ -128,18 +128,17 @@ class ProductService extends Service {
...
@@ -128,18 +128,17 @@ class ProductService extends Service {
// 1 授信贷;2 信用卡;3 普通信用卡;4 普通贷款
// 1 授信贷;2 信用卡;3 普通信用卡;4 普通贷款
async
getAllProductsByType
(
type
)
{
async
getAllProductsByType
(
type
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
url
=
this
.
config
.
NODE_BASE_URL
+
'/cassandra-server/bu_basic/list'
;
const
url
=
this
.
config
.
NODE_BASE_URL
+
'/cassandra-server/bu_basic/list'
;
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
;
}
}
products
=
products_results
.
data
.
ret
;
products
=
products_results
.
data
.
ret
;
const
sort
=
function
(
a
,
b
)
{
const
sort
=
function
(
a
,
b
)
{
if
(
a
.
recommend_sorter
===
b
.
recommend_sorter
)
{
if
(
a
.
recommend_sorter
===
b
.
recommend_sorter
)
{
...
@@ -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分组顺序推荐
...
@@ -405,12 +397,12 @@ class ProductService extends Service {
...
@@ -405,12 +397,12 @@ class ProductService extends Service {
async
formatLoanList
(
loanList
)
{
async
formatLoanList
(
loanList
)
{
//以下代码是为了处理渠道包下不展示特殊的4个业务
//
以下代码是为了处理渠道包下不展示特殊的4个业务
//start
//
start
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
user_sid
=
ctx
.
oldUserId
;
const
user_sid
=
ctx
.
oldUserId
;
let
filter
=
{
where
:
{
sid
:
user_sid
}
};
let
filter
=
{
where
:
{
sid
:
user_sid
}
};
le
t
userInfo
=
await
ctx
.
gjjModel
.
SysUser
.
one
(
filter
);
cons
t
userInfo
=
await
ctx
.
gjjModel
.
SysUser
.
one
(
filter
);
ctx
.
logger
.
info
(
'get_phone_by_user_sid:'
+
JSON
.
stringify
(
userInfo
));
ctx
.
logger
.
info
(
'get_phone_by_user_sid:'
+
JSON
.
stringify
(
userInfo
));
let
place_cid
=
0
;
let
place_cid
=
0
;
if
(
userInfo
!==
null
)
{
if
(
userInfo
!==
null
)
{
...
@@ -418,13 +410,13 @@ class ProductService extends Service {
...
@@ -418,13 +410,13 @@ class ProductService extends Service {
}
else
{
}
else
{
const
jianbing_guest_customer_id
=
ctx
.
cookies
.
get
(
'jianbing_guest_customer_id'
,
{
signed
:
false
});
const
jianbing_guest_customer_id
=
ctx
.
cookies
.
get
(
'jianbing_guest_customer_id'
,
{
signed
:
false
});
filter
=
{
where
:
{
sid
:
jianbing_guest_customer_id
}
};
filter
=
{
where
:
{
sid
:
jianbing_guest_customer_id
}
};
le
t
userInfo
=
await
ctx
.
gjjModel
.
SysGuest
.
one
(
filter
);
cons
t
userInfo
=
await
ctx
.
gjjModel
.
SysGuest
.
one
(
filter
);
if
(
userInfo
!==
null
)
{
if
(
userInfo
!==
null
)
{
place_cid
=
userInfo
.
place_cid
;
place_cid
=
userInfo
.
place_cid
;
}
}
}
}
//end
//
end
const
ret
=
[];
const
ret
=
[];
for
(
const
v
of
loanList
)
{
for
(
const
v
of
loanList
)
{
...
@@ -435,7 +427,7 @@ class ProductService extends Service {
...
@@ -435,7 +427,7 @@ class ProductService extends Service {
if
(
place_cid
>
0
&&
place_cids
.
includes
(
place_cids
)
&&
sepecial_business_ids
.
includes
(
v
.
business_id
))
{
if
(
place_cid
>
0
&&
place_cids
.
includes
(
place_cids
)
&&
sepecial_business_ids
.
includes
(
v
.
business_id
))
{
continue
;
continue
;
}
}
//end
//
end
// 处理C组
// 处理C组
let
url
=
v
.
url
;
let
url
=
v
.
url
;
...
@@ -507,11 +499,10 @@ class ProductService extends Service {
...
@@ -507,11 +499,10 @@ 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----------')
//ctx.logger.info('imh------begin----------')
...
@@ -565,7 +556,7 @@ class ProductService extends Service {
...
@@ -565,7 +556,7 @@ class ProductService extends Service {
};
};
ret
.
push
(
tmp
);
ret
.
push
(
tmp
);
}
}
}
else
{
}
else
{
const
tmp
=
{
const
tmp
=
{
type
:
v
.
type
,
type
:
v
.
type
,
...
@@ -588,11 +579,8 @@ class ProductService extends Service {
...
@@ -588,11 +579,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
;
}
}
...
...
config/config.local.js
View file @
718ae495
...
@@ -139,8 +139,8 @@ module.exports = appInfo => {
...
@@ -139,8 +139,8 @@ module.exports = appInfo => {
};
};
config
.
PHP_URL
=
'https://kaifa.jianbing.com'
;
config
.
PHP_URL
=
'https://kaifa.jianbing.com'
;
config
.
NODE_URL
=
'https://
dev
-nginx.jianbing.com/user_api/v1'
;
config
.
NODE_URL
=
'https://
uat
-nginx.jianbing.com/user_api/v1'
;
config
.
NODE_BASE_URL
=
'https://
dev
-nginx.jianbing.com'
;
config
.
NODE_BASE_URL
=
'https://
uat
-nginx.jianbing.com'
;
config
.
HOUSE_SERVICE_API
=
'https://uat-nginx.jianbing.com/house-service'
;
config
.
HOUSE_SERVICE_API
=
'https://uat-nginx.jianbing.com/house-service'
;
config
.
CDN_BASE_URL
=
'https://r.51gjj.com/image/'
;
config
.
CDN_BASE_URL
=
'https://r.51gjj.com/image/'
;
...
...
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