作者 何书鹏

测试

... ... @@ -209,23 +209,7 @@ class Goods extends Base
$detail = json_decode(json_encode($detail), true);
$detail['sku_price'] = $sku_price;
// 活动商品,不是活动规格过滤掉
$goods_sku_id_arr = [];
foreach ($detail['sku_price'] as $v) {
$goods_sku_id_arr = array_merge($v['goods_sku_id_arr'],$goods_sku_id_arr);
}
$new_sku = [];
foreach ($detail['sku'] as $val) {
$new_content = [];
foreach ($val['content'] as $value){
if(in_array($value['id'],$goods_sku_id_arr)){
$new_content[] = $value;
}
}
$val['content'] = $new_content;
$new_sku[] = $val;
}
$detail['sku'] = $new_sku;
$this->success('商品详情', $detail);
}
... ...