'array', 'goods_banners' => 'array', ]; public function getSpecArrAttr($value,$data) { $value = []; if(in_array($data['specs_type'], [1,2])){ $value = json_decode($data['specs'],true); } if($data['specs_type']== 3){ $customAttributeItems = json_decode($data['custom_attribute_items'],true); $specs = json_decode($data['specs'],true); foreach ($specs as $k=>$v){ $specStrArr = explode('-',$v); $val = []; foreach($customAttributeItems as $kk=>$vv){ if($specStrArr[0] == $vv['sign']){ $val['title'] = $vv['title']; $val['sign'] = $vv['sign']; foreach($vv['spec_items'] as $kkk=>$vvv){ if($specStrArr[1] == $vvv['spec_sign']){ $val += $vvv; } } break; } } $value[] = $val; } } return $value; } }