|
@@ -112,23 +112,23 @@ class ProductLogic extends BaseLogic |
|
@@ -112,23 +112,23 @@ class ProductLogic extends BaseLogic |
|
112
|
*/
|
112
|
*/
|
|
113
|
public function saveDetail($product_id,$detail){
|
113
|
public function saveDetail($product_id,$detail){
|
|
114
|
if(!empty($detail)){
|
114
|
if(!empty($detail)){
|
|
115
|
- try {
|
115
|
+// try {
|
|
116
|
$this->delProductDetail($product_id);
|
116
|
$this->delProductDetail($product_id);
|
|
117
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($detail, true) . PHP_EOL, FILE_APPEND);
|
117
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($detail, true) . PHP_EOL, FILE_APPEND);
|
|
118
|
foreach ($detail as $val){
|
118
|
foreach ($detail as $val){
|
|
119
|
- $columnId = $this->getColumnId($product_id,$val['column_name']);
|
|
|
|
120
|
//查看当前栏目是否存在
|
119
|
//查看当前栏目是否存在
|
|
121
|
if(empty($val['column_name'])){
|
120
|
if(empty($val['column_name'])){
|
|
122
|
continue;
|
121
|
continue;
|
|
123
|
}
|
122
|
}
|
|
|
|
123
|
+ $columnId = $this->getColumnId($product_id,$val['column_name']);
|
|
124
|
foreach ($val['data'] as $item){
|
124
|
foreach ($val['data'] as $item){
|
|
125
|
$save_data = $this->handleDetailParam($columnId['column_id'],$product_id,$item);
|
125
|
$save_data = $this->handleDetailParam($columnId['column_id'],$product_id,$item);
|
|
126
|
$this->model->add($save_data);
|
126
|
$this->model->add($save_data);
|
|
127
|
}
|
127
|
}
|
|
128
|
}
|
128
|
}
|
|
129
|
- }catch (\Exception $e){
|
|
|
|
130
|
- $this->fail('保存失败,请联系管理员.错误:'.$e->getMessage());
|
|
|
|
131
|
- }
|
129
|
+// }catch (\Exception $e){
|
|
|
|
130
|
+// $this->fail('保存失败,请联系管理员.错误:'.$e->getMessage());
|
|
|
|
131
|
+// }
|
|
132
|
}
|
132
|
}
|
|
133
|
return $this->success(['product_id'=>$product_id]);
|
133
|
return $this->success(['product_id'=>$product_id]);
|
|
134
|
}
|
134
|
}
|