|
...
|
...
|
@@ -115,15 +115,12 @@ class ProductLogic extends BaseLogic |
|
|
|
// try {
|
|
|
|
$this->delProductDetail($product_id);
|
|
|
|
foreach ($detail as $val){
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($val, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
//查看当前栏目是否存在
|
|
|
|
if(empty($val['column_name'])){
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$columnId = $this->getColumnId($product_id,$val['column_name']);
|
|
|
|
foreach ($val['data'] as $item){
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export(11111, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($item, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$save_data = $this->handleDetailParam($columnId['column_id'],$product_id,$item);
|
|
|
|
$this->model->add($save_data);
|
|
|
|
}
|
|
...
|
...
|
@@ -160,7 +157,7 @@ class ProductLogic extends BaseLogic |
|
|
|
public function getColumnId($product_id,$column_name){
|
|
|
|
$columnModel = new Column();
|
|
|
|
$columnInfo = $columnModel->read(['column_name'=>strtolower($column_name),'product_id'=>$product_id]);
|
|
|
|
if($columnInfo['id'] != 1){
|
|
|
|
if($columnInfo === false || $columnInfo['id'] != 1){
|
|
|
|
$column_id = $columnModel->addReturnId(['column_name'=>$column_name,'product_id'=>$product_id]);
|
|
|
|
}else{
|
|
|
|
$column_id = 1;
|
...
|
...
|
|