lrf %!s(int64=2) %!d(string=hai) anos
pai
achega
3268910dd3
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      app/service/trade/orderDetail.js

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

@@ -57,15 +57,19 @@ class OrderDetailService extends CrudService {
       const obj = { ...orderDetailData, shop, goods: goodsList, no: detailNo, total_detail, remarks };
       // #region 团购
       const type = _.get(order, 'type');
+      let group = _.get(order, 'group');
+      console.log(type);
+      console.log(group);
       if (type === '1') {
         // 说明是团购,需要找订单中有没有团的id
-        let group = _.get(order, 'group');
         obj.type = '1';
         obj.group = group;
+        console.log(group);
         if (!group) {
           // 需要创建团,这是团长支付的单子,开团;然后把id回补
           group = await this.ctx.service.group.group.create(obj, tran);
           obj.group = group;
+          tran.update('Order', order_id, { group, type: '1' });
         } else {
           // 需要参团操作,这是团员的单子,将人加入团中
           await this.ctx.service.group.group.join(customer, group, tran);