作者 何书鹏

活动商品总库存

@@ -38,7 +38,8 @@ class Activity extends Api @@ -38,7 +38,8 @@ class Activity extends Api
38 "goods_name": "小米Mix3", 38 "goods_name": "小米Mix3",
39 "price": "100.00", 39 "price": "100.00",
40 "line_price": "1000.00",划线价 40 "line_price": "1000.00",划线价
41 - "image_text": "图片路径" 41 + "image_text": "图片路径",
  42 + "stock_num": 68, 商品总库存
42 } 43 }
43 ] 44 ]
44 }, 45 },
@@ -77,6 +78,8 @@ class Activity extends Api @@ -77,6 +78,8 @@ class Activity extends Api
77 ->sum('number'); 78 ->sum('number');
78 $item['price'] = $goods_spec['goods_price']; 79 $item['price'] = $goods_spec['goods_price'];
79 $item['line_price'] = $goods_spec['line_price']; 80 $item['line_price'] = $goods_spec['line_price'];
  81 + // 总库存
  82 + $item->append(['stock_num']);
80 }); 83 });
81 $timeslot = $this->timeplot(); 84 $timeslot = $this->timeplot();
82 foreach ($timeslot as $key => $value){ 85 foreach ($timeslot as $key => $value){