作者 lyh

gx脚本更新路由

... ... @@ -41,7 +41,7 @@ class ProductLogic extends BaseLogic
* @time :2023/8/21 18:35
*/
public function productSave(){
try {
// try {
if(isset($this->param['id']) && !empty($this->param['id'])){
$data = $this->editProduct();
}else{
... ... @@ -51,10 +51,10 @@ class ProductLogic extends BaseLogic
KeywordRelated::saveRelated($data['id'],$this->param['keyword_id'] ?? []);//关键字关联
$this->saveExtendInfo($data['id'],$this->param['extend'] ?? []);//扩展字段
$this->saveDetail($data['id'],$this->param['detail'] ?? []);
}catch (\Exception $e){
Log::info('错误信息---'.$e->getMessage());
$this->fail('系统错误,请联系管理员');
}
// }catch (\Exception $e){
// Log::info('错误信息---'.$e->getMessage());
// $this->fail('系统错误,请联系管理员');
// }
$this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$data['route'] ?? '');
$this->curlDelRoute(['new_route'=>$data['route'] ?? '']);
return $this->success(['id'=>$data['id']]);
... ... @@ -122,6 +122,8 @@ class ProductLogic extends BaseLogic
}
$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);
}
... ...