产品编辑
This commit is contained in:
@@ -64,7 +64,14 @@ class SkuController extends BaseController
|
||||
if (isset($data['spec_json'])){
|
||||
$data['spec'] = json_decode($data['spec_json'], true);
|
||||
foreach ($data['spec'] as $k=>$v){
|
||||
$data['spec'][$k]['attr_type'] = SkuAttribute::where('id', $v['attr_id'])->value('attr_type');
|
||||
$skuAttribute = SkuAttribute::where('category_id',$data['category_id'])
|
||||
->where('attr_name', $v['attr_name'])->first();
|
||||
if ($skuAttribute){
|
||||
$data['spec'][$k]['attr_id'] = $skuAttribute['id'];
|
||||
$data['spec'][$k]['attr_type'] = $skuAttribute['attr_type'];
|
||||
}else{
|
||||
$data['spec'][$k]['attr_type'] = SkuAttribute::where('id', $v['attr_id'])->value('attr_type');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($data['category_id']))
|
||||
|
||||
Reference in New Issue
Block a user