Commit 1b6c9e4f authored by 李尚科's avatar 李尚科

fix

parent a888b170
Pipeline #13780 passed with stage
in 29 seconds
......@@ -42,7 +42,7 @@ class OrderService extends Service {
order_no: order.order_no,
report_id: order.report_id,
type: order_type,
created_time: order.created_at,
created_time: moment(order.created_at).format('YYYY-MM-DD HH:mm'),
phone: order.phone.replace(order.phone.substring(3, 7), "****"),
state: order.state,
state_text: order.state === '已支付' ? '' : order.state,
......@@ -57,7 +57,7 @@ class OrderService extends Service {
return { worth_h, worth_l }
}
//更新订单状态
//更新订单状态为已失效
async updateOrderStateToOverdue(order) {
const { ctx } = this;
......@@ -72,7 +72,7 @@ class OrderService extends Service {
// if (state === '支付中' && pay_status === 0 && moment(order.state_time).valueOf() * 300 < now_time) {
// await ctx.prometheusModel.CreditOrder.update({ state: '待支付', state_time: state_time }, { where: { id } });
// }
if (expire_time < now_time && (state === '待支付' || state === '已取消') && pay_status === 0) {
if (expire_time < now_time && (state === '待支付' || state === '已取消' || state === '支付中') && pay_status === 0) {
const ret = await ctx.prometheusModel.CreditOrder.update({ state: '已失效', state_time: state_time }, { where: { id } });
if (ret && ret[0]) {
await this.logOrder(order);
......@@ -231,9 +231,6 @@ class OrderService extends Service {
const { ctx } = this;
const user_id = ctx.userId;
const order = await ctx.prometheusModel.CreditOrder.findOne({ where: { id: order_id, user_id } });
if (order && order.pay_status === 1) {
return true;
}
if (!order || !order.id) {
ctx.failed('error order');
}
......@@ -314,7 +311,7 @@ class OrderService extends Service {
total_fee: price,
notify_url: `${this.config.OUT_P_NODE_URL}/51business/api/credit/order/wx_pay_notice`,
product_id: order.order_no,
scene_info: JSON.stringify({ h5_info: { type: 'Wap', wap_url: this.config.PHP_URL, wap_name: '我的信用' }, }),
scene_info: JSON.stringify({ h5_info: { type: 'Wap', wap_url: this.config.OUT_P_NODE_URL, wap_name: '我的信用' }, }),
};
const ret = await ctx.service.credit.common.WexinUnifiedOrder(data);//微信统一下单
......
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