Commit 5d600b90 authored by 李尚科's avatar 李尚科

gjj product fix

parent 4c78d434
Pipeline #8687 passed with stage
in 3 seconds
......@@ -8,18 +8,25 @@ class ProductController extends Controller {
const { ctx } = this;
const type = ctx.params.type || 'credit';
let suit_options;
if(type == 'loan'){
suit_options = await ctx.service.gjj.product.getLoanChannelSuitOptions();
}
const keys = ctx.query.keys ? eval(ctx.query.keys) : [];
const results = await ctx.service.gjj.product.getRecommendOptions(type, keys);
if(suit_options){
results.unshift(suit_options);
let suit_options;
let credit_loans = [];
let common_loans = [];
let common_credits = [];
if (type == 'loan') {
suit_options = await ctx.service.gjj.product.getLoanChannelSuitOptions();
if (suit_options) {
results.unshift(suit_options);
}
credit_loans = await ctx.service.gjj.product.getAllProductsByType(1);
common_loans = await ctx.service.gjj.product.getAllProductsByType(4);
} else {
common_credits = await ctx.service.gjj.product.getAllProductsByType(3);
}
const credit_loans = await ctx.service.gjj.product.getAllProductsByType(1);
const common_loans = await ctx.service.gjj.product.getAllProductsByType(4);
ctx.success({ results:results, credit_loans:credit_loans, common_loans: common_loans });
ctx.success({ results: results, credit_loans: credit_loans, common_loans: common_loans, common_credits: common_credits });
}
}
module.exports = ProductController;
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