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

fix loan_recommend bug

parent 93726b71
......@@ -4,7 +4,7 @@ module.exports = app => {
const router = app.router.namespace(app.config.projectRootPath + '/product');
router.get('third_options', '/recommend/channel/options/:type', 'gjj.product.getOptionProducts');// 筛选项
router.get('third_options', '/recommend/channel/home', 'gjj.product.getLoanHomeRecommendList'); // 贷款频道首页
router.get('/recommend/channel/options/:type', 'gjj.product.getOptionProducts');// 筛选项
router.get('/recommend/channel/home', 'gjj.product.getLoanHomeRecommendList'); // 贷款频道首页
};
......@@ -84,22 +84,32 @@ class ProductService extends Service {
_children: [],
};
const children = [{ id: -2, title: '全部', quality: credit_loans_ids, normal: common_loans_ids }];
if (user_id && app_user_id) {
children.push({
id: -3,
title: '最适合您的',
quality: await this.getSuitLoans(),
normal: common_loans_ids,
});
if (app_user_id) {
const userGjj = await ctx.helper.send_request(this.config.NODE_BASE_URL + '/cassandra-server/gjj/list/' + user_id, {}, { method: 'GET' });
if (userGjj.status === 200 && !ctx.isEmpty(userGjj.data.ret)) {
children.push({
id: -3,
title: '最适合您的',
quality: await this.getSuitLoans(),
normal: common_loans_ids,
});
} else {
children.push({
id: -4,
title: '51公积金贷',
quality: credit_loans_ids,
normal: [],
});
children.push({
id: -5,
title: '普通贷',
quality: [],
normal: common_loans_ids,
});
}
} else {
children.push({
id: -4,
title: '51公积金贷',
quality: credit_loans_ids,
normal: [],
});
children.push({
id: -5,
title: '普通贷',
quality: [],
......@@ -129,7 +139,8 @@ class ProductService extends Service {
// 最适合您的(推荐)贷款
async getSuitLoans() {
const ret = await this.getBusinessRecommendList(9999);
const results = await this.getBusinessRecommendList(9999);
const ret = R.pluck('business_id', results);
return ret;
}
......
......@@ -17,6 +17,8 @@ module.exports = appInfo => {
domainWhiteList: [],
};
config.middleware = [ 'errorHandler', 'deviceLogin', 'deviceInit', 'responseSet' ];
exports.multipart = {
// 不用steam用file
mode: 'file',
......@@ -103,13 +105,13 @@ module.exports = appInfo => {
};
config.PHP_URL = 'https://kaifa.jianbing.com';
config.NODE_URL = 'https://dev-nginx.jianbing.com/user_api/v1';
config.NODE_BASE_URL = 'https://dev-nginx.jianbing.com';
config.NODE_URL = 'https://uat-nginx.jianbing.com/user_api/v1';
config.NODE_BASE_URL = 'https://uat-nginx.jianbing.com';
config.HOUSE_SERVICE_API = 'https://uat-nginx.jianbing.com/house-service';
config.CDN_BASE_URL = 'https://r.51gjj.com/image/';
config.USER_CENTER_API_URI = 'https://dev-nginx.jianbing.com/usercenter-service';
config.USER_CENTER_API_URI = 'https://uat-nginx.jianbing.com/usercenter-service';
return config;
......
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