作者 lyh

gx

... ... @@ -199,30 +199,30 @@ class ProductLogic extends BaseLogic
* @time :2023/10/26 9:49
*/
public function editList(){
$category_ids = $this->param['category_id'];
$this->param['category_id'] = $this->handleListCategory($this->param['category_id']);
$this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']);
if(isset($this->param['gallery']) && !empty($this->param['gallery'])){
foreach ($this->param['gallery'] as $k => $v){
$v['url'] = str_replace_url($v['url']);
$this->param['gallery'][$k] = $v;
}
$this->param['thumb'] = Arr::a2s($this->param['gallery'][0] ?? []);
$this->param['gallery'] = Arr::a2s($this->param['gallery'] ?? []);
}else{
unset($this->param['thumb']);
}
try {
if(isset($this->param['route']) && !empty($this->param['route'])){
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $this->param['id'], $this->user['project_id']);
$this->editProductRoute($this->param['id'],$this->param['route']);
}
$this->model->edit($this->param,['id'=>$this->param['id']]);
//产品分类关联
CategoryRelated::saveRelated($this->param['id'], $category_ids);
}catch (\Exception $e){
$this->fail('系统错误,请连续管理员');
}
// $category_ids = $this->param['category_id'];
// $this->param['category_id'] = $this->handleListCategory($this->param['category_id']);
// $this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']);
// if(isset($this->param['gallery']) && !empty($this->param['gallery'])){
// foreach ($this->param['gallery'] as $k => $v){
// $v['url'] = str_replace_url($v['url']);
// $this->param['gallery'][$k] = $v;
// }
// $this->param['thumb'] = Arr::a2s($this->param['gallery'][0] ?? []);
// $this->param['gallery'] = Arr::a2s($this->param['gallery'] ?? []);
// }else{
// unset($this->param['thumb']);
// }
// try {
// if(isset($this->param['route']) && !empty($this->param['route'])){
// $this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $this->param['id'], $this->user['project_id']);
// $this->editProductRoute($this->param['id'],$this->param['route']);
// }
// $this->model->edit($this->param,['id'=>$this->param['id']]);
// //产品分类关联
// CategoryRelated::saveRelated($this->param['id'], $category_ids);
// }catch (\Exception $e){
// $this->fail('系统错误,请连续管理员');
// }
return $this->success();
}
... ...