Browse Source

[Chg] Add goods_type in order_goods

Ark 4 years ago
parent
commit
c978154b08
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/api/controller/order.js

+ 5 - 4
src/api/controller/order.js

@@ -257,8 +257,7 @@ module.exports = class extends Base {
     }
     }
 
 
     // 统计商品总价
     // 统计商品总价
-    const orderGoodsData = [];
-    orderGoodsData.push({
+    const orderGoodsData = {
       order_id: orderId,
       order_id: orderId,
       goods_id: checkedGoodsId,
       goods_id: checkedGoodsId,
       goods_sn: checkedGoods.goods_sn,
       goods_sn: checkedGoods.goods_sn,
@@ -270,9 +269,11 @@ module.exports = class extends Base {
       number: this.post('goodsCount'),
       number: this.post('goodsCount'),
       goods_specifition_name_value: checkedGoods.goods_specifition_name_value,
       goods_specifition_name_value: checkedGoods.goods_specifition_name_value,
       goods_specifition_ids: checkedGoods.goods_specifition_ids
       goods_specifition_ids: checkedGoods.goods_specifition_ids
-    });
+    };
 
 
-    await this.model('order_goods').addMany(orderGoodsData);
+    if (checkedGoods.promotion_desc.length > 0) orderGoodsData.goods_type = 100;
+
+    await this.model('order_goods').addMany([orderGoodsData]);
 
 
     return this.success({ orderInfo: orderInfo });
     return this.success({ orderInfo: orderInfo });
   }
   }