|
...
|
...
|
@@ -294,7 +294,7 @@ class ProductLogic extends BaseLogic |
|
|
|
$info = $this->model->read(['id'=>$id]);
|
|
|
|
if($info['route'] != $route){
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route);
|
|
|
|
$this->curlDelRoute($info['route']);
|
|
|
|
$this->curlDelRoute(['route'=>$info['route'],'new_route'=>$route]);
|
|
|
|
}
|
|
|
|
return $route;
|
|
|
|
}
|
|
...
|
...
|
@@ -341,7 +341,7 @@ class ProductLogic extends BaseLogic |
|
|
|
RouteMap::delRoute(RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']);
|
|
|
|
//生成一条删除路由记录
|
|
|
|
$info = $this->model->read(['id'=>$id],['id','route']);
|
|
|
|
$this->curlDelRoute($info['route']);
|
|
|
|
$this->curlDelRoute(['route'=>$info['route']]);
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -648,6 +648,32 @@ class ProductLogic extends BaseLogic |
|
|
|
'description' => $data[10]??''
|
|
|
|
];
|
|
|
|
|
|
|
|
//处理描述切换栏
|
|
|
|
$describe = [];
|
|
|
|
if($data[11]){
|
|
|
|
//处理描述切换栏中的图片
|
|
|
|
$describe = json_decode($data[11],true);
|
|
|
|
|
|
|
|
foreach ($describe as &$v_desc){
|
|
|
|
|
|
|
|
preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $v_desc['text'], $result_desc);
|
|
|
|
|
|
|
|
if($result_desc[2]??[]){
|
|
|
|
foreach ($result_desc[2] as $vdesc_img){
|
|
|
|
$v_desc['text'] = str_replace($vdesc_img,getImageUrl(CosService::uploadRemote($project_id,'image_product',$vdesc_img)),$v_desc['text']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//处理描述切换栏中的视频
|
|
|
|
preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $v_desc['text'], $result_desc_video);
|
|
|
|
if($result_desc_video[2]??[]){
|
|
|
|
foreach ($result_desc_video[2] as $vdesc_video){
|
|
|
|
$v_desc['text'] = str_replace($vdesc_video,getImageUrl(CosService::uploadRemote($project_id,'image_product',$vdesc_video)),$v_desc['text']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$id = $this->model->addReturnId(
|
|
|
|
[
|
|
|
|
'project_id' => $project_id,
|
|
...
|
...
|
@@ -659,6 +685,7 @@ class ProductLogic extends BaseLogic |
|
|
|
'keyword_id' => $keyword_id,
|
|
|
|
'intro' => $intro,
|
|
|
|
'content' => $content,
|
|
|
|
'describe' => Arr::a2s($describe),
|
|
|
|
'seo_mate' => Arr::a2s($seo_mate),
|
|
|
|
'created_uid' => $user_id,
|
|
|
|
'status' => Product::STATUS_ON
|
...
|
...
|
|