Commit abc13e8b authored by 李尚科's avatar 李尚科

fix order

parent 6b28adbc
Pipeline #13468 passed with stage
in 23 seconds
...@@ -10,8 +10,8 @@ class CallriskController extends Controller { ...@@ -10,8 +10,8 @@ class CallriskController extends Controller {
async getReport() { async getReport() {
const { ctx } = this; const { ctx } = this;
const report_no = ctx.params.report_no; const report_id = ctx.params.report_id;
let ret = await ctx.service.credit.callrisk.getReport(report_no); let ret = await ctx.service.credit.callrisk.getReport(report_id);
ctx.success(ret); ctx.success(ret);
} }
...@@ -34,7 +34,7 @@ class CallriskController extends Controller { ...@@ -34,7 +34,7 @@ class CallriskController extends Controller {
//TODO 三要素校验 调用数据服务接口 //TODO 三要素校验 调用数据服务接口
......
...@@ -55,9 +55,9 @@ module.exports = app => { ...@@ -55,9 +55,9 @@ module.exports = app => {
}, },
} }
}, { }, {
timestamps: false, timestamps: false,
tableName: 'credit_order', tableName: 'credit_order',
}); });
return CreditOrder; return CreditOrder;
......
...@@ -11,7 +11,7 @@ module.exports = app => { ...@@ -11,7 +11,7 @@ module.exports = app => {
//我的信用-个人通话风险 //我的信用-个人通话风险
router.get('/callrisk/report/:report_no', 'credit.callrisk.getReport');//获取报告信息 router.get('/callrisk/report/:report_id', 'credit.callrisk.getReport');//获取报告信息
router.post('/callrisk/query', 'credit.callrisk.queryCallRisk');//查询个人通话信息 router.post('/callrisk/query', 'credit.callrisk.queryCallRisk');//查询个人通话信息
......
...@@ -30,13 +30,13 @@ class CallriskService extends Service { ...@@ -30,13 +30,13 @@ class CallriskService extends Service {
} }
async getReport(report_no) { async getReport(report_id) {
const { ctx } = this; const { ctx } = this;
const basics = await ctx.prometheusModel.CreditCallriskReport.one({ where: { report_no } }); const basics = await ctx.prometheusModel.CreditCallriskReport.one({ where: { report_id } });
if (!basics || !basics.id) { if (!basics || !basics.id) {
ctx.failed('error report_no'); ctx.failed('error report_id');
} }
const report_id = basics.id; const report_id = basics.id;
const call_overview = await this.getCallOverview(report_id); const call_overview = await this.getCallOverview(report_id);
......
...@@ -22,19 +22,18 @@ class OrderService extends Service { ...@@ -22,19 +22,18 @@ class OrderService extends Service {
const worth_h = []; const worth_h = [];
const worth_l = []; const worth_l = [];
const worth_time = type === 1 ? 15 : 30; const worth_time = type === 1 ? 15 : 30;
const now_time = moment().format('X'); const now_time = moment().valueOf();
for (let i in order_records) { for (let i in order_records) {
const order = order_records[i]; const order = order_records[i];
const expire_time = moment(state_time).format('X') + worth_time * 86400; const expire_time = moment(order.state_time).valueOf() + worth_time * 86400;
const apply = { phone: '15968762898', report_no: '51gjj201909050100001' }; const apply = { phone: '15968762898', report_no: '51gjj201909050100001' };
const item = { const item = {
order_id: order.id,
order_no: order.order_no, order_no: order.order_no,
report_no: apply.report_no, report_id: apply.report_id,
type: order_type, type: order_type,
created_time, created_time: order.created_time,
phone: apply.phone.replace(apply.phone.substring(3, 7), "****"), phone: apply.phone.replace(apply.phone.substring(3, 7), "****"),
state: order.state, state: order.state,
state_text: order.state === '已支付' ? '' : order.state, state_text: order.state === '已支付' ? '' : order.state,
...@@ -47,7 +46,6 @@ class OrderService extends Service { ...@@ -47,7 +46,6 @@ class OrderService extends Service {
} }
return { worth_h, worth_l } return { worth_h, worth_l }
} }
/** /**
...@@ -75,6 +73,7 @@ class OrderService extends Service { ...@@ -75,6 +73,7 @@ class OrderService extends Service {
} }
} }
module.exports = OrderService; module.exports = OrderService;
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