作者 何书鹏

测试

... ... @@ -209,6 +209,18 @@ 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);
}
foreach ($detail['sku'] as $val) {
foreach ($val['content'] as $value){
if(!in_array($value['id'],$goods_sku_id_arr)){
unset($value);
}
}
}
$this->success('商品详情', $detail);
}
... ...