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

fix credit bug

parent 329d396a
Pipeline #8852 passed with stage
in 4 seconds
...@@ -89,7 +89,7 @@ class ProductService extends Service { ...@@ -89,7 +89,7 @@ class ProductService extends Service {
id: -3, id: -3,
title: '最适合您的', title: '最适合您的',
quality: await this.getSuitLoans(), quality: await this.getSuitLoans(),
normal: [], normal: common_loans_ids,
}); });
} else { } else {
...@@ -369,15 +369,21 @@ class ProductService extends Service { ...@@ -369,15 +369,21 @@ class ProductService extends Service {
const { ctx } = this; const { ctx } = this;
const ret = []; const ret = [];
const channel = ctx.channel; const channel = ctx.channel;
let location = 'loan_channel';
for (const v of products) { for (const v of products) {
if (Number(v.type) === 2 || Number(v.type) === 3) {
v.rate = '';
v.rate_title = '';
location = 'credit_channel';
}
const channels = ctx.isEmpty(v.channel_rate_id) ? [] : v.channel_rate_id.split(','); const channels = ctx.isEmpty(v.channel_rate_id) ? [] : v.channel_rate_id.split(',');
const rate = channels.includes(channel) ? (v.channel_rate.includes('元') ? v.channel_rate : v.channel_rate + '%') : (v.rate.includes('元') ? v.rate : v.rate + '%'); const rate = channels.includes(channel) ? (v.channel_rate.includes('元') ? v.channel_rate : v.channel_rate + '%') : (!ctx.isEmpty(v.rate) ? (v.rate.includes('元') ? v.rate : v.rate + '%') : '');
const rateTitle = channels.includes(channel) ? v.channel_rate_title : v.rate_title; const rateTitle = channels.includes(channel) ? v.channel_rate_title : v.rate_title;
let url = v.url; let url = v.url;
if (Number(v.type) === 4) { if (Number(v.type) === 4) {
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=loan_channel'; url = this.config.PHP_URL + '/app/track/url?url=' + encodeURI(url) + '&source=51gjj&location=' + location;
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