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

fix city_state bug

parent dedfeb5c
Pipeline #17855 passed with stage
in 53 seconds
......@@ -135,7 +135,6 @@ class ProductService extends Service {
const products_results = await ctx.helper.send_request(url, { type, app_id: ctx.appId }, { method: 'GET' });
// ctx.logger.info(JSON.stringify({ url, products_results }));
let products = [];
console.log(products_results);
if (products_results.status !== 200 || !products_results.data || !products_results.data.ret) {
return products;
}
......@@ -207,15 +206,8 @@ class ProductService extends Service {
// 获取普通贷款
async getCommonBusinessList() {
const { ctx } = this;
const url = ctx.app.config.NODE_BASE_URL + '/cassandra-server/bu_basic/list';
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;
const ret = await this.getAllProductsByType(4);
return ret;
}
// 获取推荐列表,按照ABC分组顺序推荐
......@@ -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) {
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) {
ctx.logger.info('imh------begin----------');
if (Number(v.type) === 2 || Number(v.type) === 3) {
v.rate = '';
v.rate_title = '';
......@@ -504,12 +496,10 @@ class ProductService extends Service {
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;
ctx.logger.info(v.cities);
ctx.logger.info(city);
if (v.cities && v.cities.length > 0 && city != '') {
ctx.logger.info('imh------222----------');
if ((v.cities.includes(city) && Number(v.city_status) === 1) || (!v.cities.includes(city) && Number(v.city_status) === 0) ) {
ctx.logger.info('imh----------------');
ctx.logger.info(v.business_id, v.type);
ctx.logger.info(JSON.stringify(v.cities));
if ((v.cities.includes(city) && Number(v.city_state) === 1) || (!v.cities.includes(city) && Number(v.city_state) === 0) ) {
const tmp = {
type: v.type,
business_id: v.business_id,
......@@ -554,11 +544,8 @@ class ProductService extends Service {
};
ret.push(tmp);
}
ctx.logger.info('imh------end----------');
}
ctx.logger.info('check city end');
return ret;
}
......
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