作者 lyh

gx脚本更新路由

@@ -114,17 +114,19 @@ class ProductLogic extends BaseLogic @@ -114,17 +114,19 @@ class ProductLogic extends BaseLogic
114 $this->delProductDetail($product_id); 114 $this->delProductDetail($product_id);
115 if(!empty($detail)){ 115 if(!empty($detail)){
116 try { 116 try {
117 - foreach ($detail as $key =>$val){  
118 - //查看当前栏目是否存在  
119 - $columnId = $this->getColumnId($product_id,$key); 117 + foreach ($detail as $val){
120 foreach ($val as $v){ 118 foreach ($val as $v){
121 - if(empty($key)){ 119 + //查看当前栏目是否存在
  120 + $columnId = $this->getColumnId($product_id,$v['column_name']);
  121 + if(empty($v['column_name'])){
122 continue; 122 continue;
123 } 123 }
124 - $save_data = $this->handleDetailParam($columnId['column_id'],$product_id,$v); 124 + foreach ($v['data'] as $item){
  125 + $save_data = $this->handleDetailParam($columnId['column_id'],$product_id,$item);
125 $this->model->add($save_data); 126 $this->model->add($save_data);
126 } 127 }
127 } 128 }
  129 + }
128 }catch (\Exception $e){ 130 }catch (\Exception $e){
129 $this->fail('保存失败,请联系管理员.错误:'.$e->getMessage()); 131 $this->fail('保存失败,请联系管理员.错误:'.$e->getMessage());
130 } 132 }