$type =Db::name('shop_goods_spu_specification')//查询商品规格维度
->field('id,parent_id,title')
->where('spu_id',$goods_id)
->select();
$type1=Db::name('shop_goods_spu_specification_sub')//查询商品规格维度详情
->field('id,spec_id,title')
->where('id','in',$arr)
->select();
//dump($arr);die();
$arr=[];//处理数据进行组合数组进行返回
foreach ($type1 as &$v){
$arr[$v['spec_id']][]=$v;
}
foreach ($type as &$value){
$value['son']=$arr[$value['id']];
}
// dump($type);die();
return $type; //返回数据