Commit 89e0690d authored by Hsinli's avatar Hsinli

addd

parent cf3a719c
Pipeline #13714 passed with stage
in 28 seconds
......@@ -15,9 +15,6 @@ module.exports = app => {
app_user_id: STRING,
app_id: STRING,
app_type_id: STRING,
name: STRING,
phone: STRING,
id_card: STRING,
service_code: STRING,
timestamp: STRING,
appkey: STRING,
......
......@@ -196,11 +196,11 @@ class ApplyService extends Service {
}
//判断用户当前三要素是否是二次查询未支付订单
let bePayOrderInfo = await ctx.service.credit.order.getBePayOrderByThree('blacklist', inputParams);
if (bePayOrderInfo.have) {
let bePayOrder = await ctx.service.credit.order.getBePayOrderByThree('blacklist', inputParams);
if (bePayOrder !== null) {
ret.second = true;
ret.order_id = bePayOrderInfo.order.id;
ret.report_id = bePayOrderInfo.order.report_id;
ret.order_id = bePayOrder.id;
ret.report_id = bePayOrder.report_id;
return ret;
}
......@@ -242,9 +242,6 @@ class ApplyService extends Service {
app_user_id: ctx.appUserId,
app_id: ctx.appId,
app_type_id: ctx.appTypeId,
name: inputParams.name,
phone: inputParams.phone,
id_card: inputParams.id_card,
timestamp: params.signParams.timestamp,
appkey: this.config.BLACKLIST_APPLY_APPKEY,
sign: params.sign,
......
......@@ -252,14 +252,11 @@ class OrderService extends Service {
/**
* 获得当前三要素是否有待支付的订单
* @param {*} params name,phone,id_card
* @param {*} type 类型blacklist/callrisk
* @param {*} threeParams 三要素
*/
async getBePayOrderByThree(type, threeParams) {
const { ctx } = this;
let ret = {
have: false,
order: {}
}
if (!TypeConfig.hasOwnProperty(type)) {
return ret;
}
......@@ -267,33 +264,16 @@ class OrderService extends Service {
where: {
user_id: ctx.userId,
type: TypeConfig[type],
name: threeParams.name,
phone: threeParams.phone,
id_card: threeParams.id_card,
state: '待支付',
valid: 1,
state_time: { $gte: moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm:ss') }
}
}
let list = await ctx.prometheusModel.CreditOrder.findAll(orderFilter);
if (list !== undefined) {
for (let i in list) {
let filter = {
where: {
id: list[i].apply_id,
name: threeParams.name,
phone: threeParams.phone,
id_card: threeParams.id_card,
type: TypeConfig[type],
valid: 1
}
}
let applyInfo = await ctx.prometheusModel.CreditApply.findOne(filter);
if (applyInfo !== null) {
ret.have = true;
ret.order = list[i];
break;
}
}
}
return ret;
let order = await ctx.prometheusModel.CreditOrder.findOne(orderFilter);
return order;
}
//统一下单
......
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