lrf 2 anni fa
parent
commit
15622e2569

+ 1 - 1
app/service/trade/orderDetail.js

@@ -25,7 +25,7 @@ class OrderDetailService extends CrudService {
     if (!order) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到支付订单的数据');
     if (!order) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未找到支付订单的数据');
     const { customer, address, goods, no, status, buy_time, pay } = order;
     const { customer, address, goods, no, status, buy_time, pay } = order;
     if (status === '0') throw new BusinessError(ErrorCode.DATA_INVALID, '订单未支付');
     if (status === '0') throw new BusinessError(ErrorCode.DATA_INVALID, '订单未支付');
-    const orderDetailData = { customer, address, order: order_id, buy_time, pay_time: _.get(pay, 'pay_time', status) };
+    const orderDetailData = { customer, address, order: order_id, buy_time, pay_time: _.get(pay, 'pay_time'), status };
     // 补全 shop, goods, total_detail TODO: 补全 discount;
     // 补全 shop, goods, total_detail TODO: 补全 discount;
     // const arr = [];
     // const arr = [];
     let noTimes = 1;
     let noTimes = 1;

+ 1 - 0
app/service/trade/pay.js

@@ -111,6 +111,7 @@ class PayService extends CrudService {
     // 修改状态
     // 修改状态
     try {
     try {
       this.tran.update('Order', orderData._id, { pay: payData, status: '1' });
       this.tran.update('Order', orderData._id, { pay: payData, status: '1' });
+      await this.tran.run();
       // 加积分
       // 加积分
       await this.ctx.service.user.point.afterPayOrder({ order_id: orderData._id, openid }, this.tran);
       await this.ctx.service.user.point.afterPayOrder({ order_id: orderData._id, openid }, this.tran);
       // 拆订单
       // 拆订单

+ 1 - 1
app/service/user/point.js

@@ -38,7 +38,7 @@ class PointService extends CrudService {
     const pointData = {
     const pointData = {
       customer,
       customer,
       point,
       point,
-      time: moment().format('YYYY-MM-D HH:mm:ss'),
+      time: moment().format('YYYY-MM-DD HH:mm:ss'),
       source: '0',
       source: '0',
     };
     };
     tran.insert(point, pointData);
     tran.insert(point, pointData);