Commit 3a8e13d6 authored by 任国军's avatar 任国军

fix city check

parent 9e1f09a9
Pipeline #17889 passed with stage
in 52 seconds
...@@ -423,11 +423,11 @@ class ProductService extends Service { ...@@ -423,11 +423,11 @@ class ProductService extends Service {
const ret = []; const ret = [];
for (const v of loanList) { for (const v of loanList) {
//以下代码是为了处理渠道包下不展示特殊的4个业务 // 以下代码是为了处理渠道包下不展示特殊的4个业务
//start // start
let sepecial_business_ids = [95, 7, 130, 51, 99, 111]; const sepecial_business_ids = [ 95, 7, 130, 51, 99, 111 ];
let place_cids = [1210, 1211, 5492, 5719, 2420] const place_cids = [ 1210, 1211, 5492, 5719, 2420 ];
if(ctx.helper.toInt(place_cid) > 0 && place_cids.includes(ctx.helper.toInt(place_cid)) && sepecial_business_ids.includes(ctx.helper.toInt(v.business_id))) { if (ctx.helper.toInt(place_cid) > 0 && place_cids.includes(ctx.helper.toInt(place_cid)) && sepecial_business_ids.includes(ctx.helper.toInt(v.business_id))) {
ctx.logger.info('get_phone_by_user_place_business:' + place_cid + '--business_id--' + v.business_id); ctx.logger.info('get_phone_by_user_place_business:' + place_cid + '--business_id--' + v.business_id);
continue; continue;
} }
...@@ -500,9 +500,9 @@ class ProductService extends Service { ...@@ -500,9 +500,9 @@ class ProductService extends Service {
ctx.logger.info('get_phone_by_user_place:' + place_cid); ctx.logger.info('get_phone_by_user_place:' + place_cid);
// end // end
if(type == 4) { if (type == 4) {
let city_res = await ctx.helper.parseIp(); const city_res = await ctx.helper.parseIp();
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(JSON.stringify(city_res)); ctx.logger.info(JSON.stringify(city_res));
...@@ -510,17 +510,17 @@ class ProductService extends Service { ...@@ -510,17 +510,17 @@ class ProductService extends Service {
ctx.logger.info('check loan city:' + city); 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----------')
//以下代码是为了处理渠道包下不展示特殊的4个业务 // 以下代码是为了处理渠道包下不展示特殊的4个业务
//start // start
let sepecial_business_ids = [95, 7, 130, 51, 99, 111]; const sepecial_business_ids = [ 95, 7, 130, 51, 99, 111 ];
let place_cids = [1210, 1211, 5492, 5719, 2420] const place_cids = [ 1210, 1211, 5492, 5719, 2420 ];
if(ctx.helper.toInt(place_cid) > 0 && place_cids.includes(ctx.helper.toInt(place_cid)) && sepecial_business_ids.includes(ctx.helper.toInt(v.business_id))) { if (ctx.helper.toInt(place_cid) > 0 && place_cids.includes(ctx.helper.toInt(place_cid)) && sepecial_business_ids.includes(ctx.helper.toInt(v.business_id))) {
ctx.logger.info('get_phone_by_user_place_business:' + place_cid + '--business_id--' + v.business_id); ctx.logger.info('get_phone_by_user_place_business:' + place_cid + '--business_id--' + v.business_id);
continue; continue;
} }
//end // end
if (Number(v.type) === 2 || Number(v.type) === 3) { if (Number(v.type) === 2 || Number(v.type) === 3) {
v.rate = ''; v.rate = '';
...@@ -535,13 +535,13 @@ class ProductService extends Service { ...@@ -535,13 +535,13 @@ class ProductService extends Service {
if (Number(v.type) === 4 && !url.includes('51yhdai')) { if (Number(v.type) === 4 && !url.includes('51yhdai')) {
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=' + encodeURI(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(v.cities)
//ctx.logger.info(city) // 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('imh------222----------')
if(v.cities.includes(city)) { if ((v.cities.includes(city) && Number(v.city_state) === 1) || (!v.cities.includes(city) && Number(v.city_state) === 0)) {
//ctx.logger.info('imh----------------') // ctx.logger.info('imh----------------')
const tmp = { const tmp = {
type: v.type, type: v.type,
business_id: v.business_id, business_id: v.business_id,
......
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