作者 jinglong
1 个管道 的构建 通过 耗费 0 秒

修改购物车库存

@@ -137,6 +137,9 @@ class Cars extends Api @@ -137,6 +137,9 @@ class Cars extends Api
137 $value['goods_number'] = $value['stock']; 137 $value['goods_number'] = $value['stock'];
138 } 138 }
139 139
  140 + $s_index = array_search($value['style'],Common::salePrice($value['g_style']));
  141 + $stock = Common::salePrice($value['stock'])[$s_index];
  142 + $value['stock'] = $stock;
140 } 143 }
141 // $total_price = array_sum(array_map(function ($product_row) { 144 // $total_price = array_sum(array_map(function ($product_row) {
142 // return $product_row['price'] * $product_row['goods_number']; 145 // return $product_row['price'] * $product_row['goods_number'];