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