lrf 2 anos atrás
pai
commit
a5adc24301
1 arquivos alterados com 8 adições e 2 exclusões
  1. 8 2
      app/service/trade/order.js

+ 8 - 2
app/service/trade/order.js

@@ -261,7 +261,6 @@ class OrderService extends CrudService {
     await this.orderUtil.dealAct_gift(goodsList, giftActs);
   }
 
-
   /**
    * 处理该订单活动部分
    * * 该商品可能会参加多个活动,活动之间有叠加问题
@@ -386,7 +385,7 @@ class OrderService extends CrudService {
       ]);
       let gs = _.head(d);
       if (gs) gs = JSON.parse(JSON.stringify(gs));
-      if (cart_id)gs.cart_id = cart_id;
+      if (cart_id) gs.cart_id = cart_id;
       arr.push(gs);
     }
     // 平铺数据后,需要处理活动相关部分
@@ -433,6 +432,13 @@ class OrderService extends CrudService {
     return data;
   }
 
+  async afterFetch(filter, data) {
+    data = JSON.parse(JSON.stringify(data));
+    const total_detail = _.get(data, 'total_detail', {});
+    data.total_detail = await this.ctx.service.trade.orderDetail.fetchResetTotalDetail(total_detail);
+    return data;
+  }
+
   async toMakeTask(order_id) {
     const { taskMqConfig } = this.app.config;
     const data = { service: 'trade.order', method: 'cancel', params: { order_id } };