Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop
正在显示
12 个修改的文件
包含
51 行增加
和
22 行删除
| @@ -183,7 +183,7 @@ class ProjectImport extends Command | @@ -183,7 +183,7 @@ class ProjectImport extends Command | ||
| 183 | protected function get_code_type($file) | 183 | protected function get_code_type($file) |
| 184 | { | 184 | { |
| 185 | $list = array('GBK', 'UTF-8'); | 185 | $list = array('GBK', 'UTF-8'); |
| 186 | - $str = file_get_contents($file); | 186 | + $str = curl_c($file,false); |
| 187 | foreach ($list as $item) { | 187 | foreach ($list as $item) { |
| 188 | $tmp = mb_convert_encoding($str, $item, $item); | 188 | $tmp = mb_convert_encoding($str, $item, $item); |
| 189 | if (md5($tmp) == md5($str)) { | 189 | if (md5($tmp) == md5($str)) { |
| @@ -379,7 +379,7 @@ class BTemplateLogic extends BaseLogic | @@ -379,7 +379,7 @@ class BTemplateLogic extends BaseLogic | ||
| 379 | } | 379 | } |
| 380 | } | 380 | } |
| 381 | $this->addUpdateNotify($type,$route); | 381 | $this->addUpdateNotify($type,$route); |
| 382 | - return $this->curlDelRoute($route); | 382 | + return $this->curlDelRoute(['route'=>$route,'new_route'=>$route]); |
| 383 | } | 383 | } |
| 384 | 384 | ||
| 385 | /** | 385 | /** |
| @@ -113,7 +113,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -113,7 +113,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 113 | } | 113 | } |
| 114 | //通知 | 114 | //通知 |
| 115 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$info['url']); | 115 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$info['url']); |
| 116 | - $this->curlDelRoute($info['url']); | 116 | + $this->curlDelRoute(['route'=>$info['url'],'new_route'=>$info['url']]); |
| 117 | return $this->success(); | 117 | return $this->success(); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| @@ -213,7 +213,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -213,7 +213,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 213 | } | 213 | } |
| 214 | if($info['url'] != $route){ | 214 | if($info['url'] != $route){ |
| 215 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route); | 215 | $this->addUpdateNotify(RouteMap::SOURCE_PAGE,$route); |
| 216 | - $this->curlDelRoute($info['url']); | 216 | + $this->curlDelRoute(['route'=>$info['url'],'new_route'=>$route]); |
| 217 | } | 217 | } |
| 218 | return true; | 218 | return true; |
| 219 | } | 219 | } |
| @@ -259,7 +259,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -259,7 +259,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 259 | RouteMap::delRoute(RouteMap::SOURCE_PAGE, $id, $this->user['project_id']); | 259 | RouteMap::delRoute(RouteMap::SOURCE_PAGE, $id, $this->user['project_id']); |
| 260 | //生成一条删除路由记录 | 260 | //生成一条删除路由记录 |
| 261 | $info = $this->model->read(['id' => $id], ['id', 'url']); | 261 | $info = $this->model->read(['id' => $id], ['id', 'url']); |
| 262 | - $this->curlDelRoute($info['url']); | 262 | + $this->curlDelRoute(['route'=>$info['url']]); |
| 263 | return $this->success(); | 263 | return $this->success(); |
| 264 | } | 264 | } |
| 265 | 265 |
| @@ -357,12 +357,12 @@ class VisualizationLogic extends BaseLogic | @@ -357,12 +357,12 @@ class VisualizationLogic extends BaseLogic | ||
| 357 | $newsInfo = $newsModel->read(['id'=>$source_id],['url']); | 357 | $newsInfo = $newsModel->read(['id'=>$source_id],['url']); |
| 358 | $route = $newsInfo['url']; | 358 | $route = $newsInfo['url']; |
| 359 | }else{ | 359 | }else{ |
| 360 | - $type = 0; | 360 | + $type = 'all'; |
| 361 | $route = 'all'; | 361 | $route = 'all'; |
| 362 | } | 362 | } |
| 363 | } | 363 | } |
| 364 | $this->addUpdateNotify($type,$route); | 364 | $this->addUpdateNotify($type,$route); |
| 365 | - return $this->curlDelRoute($route); | 365 | + return $this->curlDelRoute(['route'=>$route,'new_route'=>$route]); |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | /** | 368 | /** |
| @@ -169,8 +169,10 @@ class BaseLogic extends Logic | @@ -169,8 +169,10 @@ class BaseLogic extends Logic | ||
| 169 | * @method :post | 169 | * @method :post |
| 170 | * @time :2023/11/30 14:43 | 170 | * @time :2023/11/30 14:43 |
| 171 | */ | 171 | */ |
| 172 | - public function curlDelRoute($route){ | ||
| 173 | - $url = $this->user['domain'].'api/delHtml/?project_id='.$this->user['project_id'].'&route='.$route; | 172 | + public function curlDelRoute($data){ |
| 173 | + $data['project_id'] = $this->user['project_id']; | ||
| 174 | + $str = http_build_query($data); | ||
| 175 | + $url = $this->user['domain'].'api/delHtml/?'.$str; | ||
| 174 | curlGet($url); | 176 | curlGet($url); |
| 175 | return $this->success(); | 177 | return $this->success(); |
| 176 | } | 178 | } |
| @@ -113,7 +113,7 @@ class BlogCategoryLogic extends BaseLogic | @@ -113,7 +113,7 @@ class BlogCategoryLogic extends BaseLogic | ||
| 113 | $info = $this->model->read(['id'=>$id],['id','alias']); | 113 | $info = $this->model->read(['id'=>$id],['id','alias']); |
| 114 | if($info['alias'] != $route){ | 114 | if($info['alias'] != $route){ |
| 115 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG_CATE,$route); | 115 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG_CATE,$route); |
| 116 | - $this->curlDelRoute($info['alias']); | 116 | + $this->curlDelRoute(['route'=>$info['alias'],'new_route'=>$route]); |
| 117 | } | 117 | } |
| 118 | return true; | 118 | return true; |
| 119 | } | 119 | } |
| @@ -306,7 +306,7 @@ class BlogCategoryLogic extends BaseLogic | @@ -306,7 +306,7 @@ class BlogCategoryLogic extends BaseLogic | ||
| 306 | RouteMap::delRoute(RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']); | 306 | RouteMap::delRoute(RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']); |
| 307 | //生成一条删除路由记录 | 307 | //生成一条删除路由记录 |
| 308 | $info = $this->model->read(['id'=>$id],['id','alias']); | 308 | $info = $this->model->read(['id'=>$id],['id','alias']); |
| 309 | - $this->curlDelRoute($info['alias']); | 309 | + $this->curlDelRoute(['route'=>$info['alias']]); |
| 310 | return $this->success(); | 310 | return $this->success(); |
| 311 | } | 311 | } |
| 312 | 312 |
| @@ -63,7 +63,7 @@ class BlogLogic extends BaseLogic | @@ -63,7 +63,7 @@ class BlogLogic extends BaseLogic | ||
| 63 | $info = $this->model->read(['id'=>$id],['id','url']); | 63 | $info = $this->model->read(['id'=>$id],['id','url']); |
| 64 | if($info['url'] != $route){ | 64 | if($info['url'] != $route){ |
| 65 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); | 65 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); |
| 66 | - $this->curlDelRoute($info['url']); | 66 | + $this->curlDelRoute(['route'=>$info['url'],'new_route'=>$route]); |
| 67 | } | 67 | } |
| 68 | return true; | 68 | return true; |
| 69 | } | 69 | } |
| @@ -155,7 +155,7 @@ class BlogLogic extends BaseLogic | @@ -155,7 +155,7 @@ class BlogLogic extends BaseLogic | ||
| 155 | RouteMap::delRoute(RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); | 155 | RouteMap::delRoute(RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); |
| 156 | //生成一条删除路由记录 | 156 | //生成一条删除路由记录 |
| 157 | $info = $this->model->read(['id'=>$id],['id','url']); | 157 | $info = $this->model->read(['id'=>$id],['id','url']); |
| 158 | - $this->curlDelRoute($info['url']); | 158 | + $this->curlDelRoute(['route'=>$info['url']]); |
| 159 | return $this->success(); | 159 | return $this->success(); |
| 160 | } | 160 | } |
| 161 | 161 |
| @@ -123,7 +123,7 @@ class NewsCategoryLogic extends BaseLogic | @@ -123,7 +123,7 @@ class NewsCategoryLogic extends BaseLogic | ||
| 123 | $info = $this->model->read(['id'=>$id],['id','alias']); | 123 | $info = $this->model->read(['id'=>$id],['id','alias']); |
| 124 | if($info['alias'] != $route){ | 124 | if($info['alias'] != $route){ |
| 125 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route); | 125 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route); |
| 126 | - $this->curlDelRoute($info['alias']); | 126 | + $this->curlDelRoute(['route'=>$info['alias'],'new_route'=>$route]); |
| 127 | } | 127 | } |
| 128 | return true; | 128 | return true; |
| 129 | } | 129 | } |
| @@ -287,7 +287,7 @@ class NewsCategoryLogic extends BaseLogic | @@ -287,7 +287,7 @@ class NewsCategoryLogic extends BaseLogic | ||
| 287 | //删除路由映射 | 287 | //删除路由映射 |
| 288 | RouteMap::delRoute(RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); | 288 | RouteMap::delRoute(RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); |
| 289 | $info = $this->model->read(['id'=>$id],['id','alias']); | 289 | $info = $this->model->read(['id'=>$id],['id','alias']); |
| 290 | - $this->curlDelRoute($info['alias']); | 290 | + $this->curlDelRoute(['route'=>$info['alias']]); |
| 291 | return $this->success(); | 291 | return $this->success(); |
| 292 | } | 292 | } |
| 293 | 293 |
| @@ -95,7 +95,7 @@ class NewsLogic extends BaseLogic | @@ -95,7 +95,7 @@ class NewsLogic extends BaseLogic | ||
| 95 | $info = $this->model->read(['id' => $id], ['id', 'url']); | 95 | $info = $this->model->read(['id' => $id], ['id', 'url']); |
| 96 | if ($info['url'] != $route) { | 96 | if ($info['url'] != $route) { |
| 97 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); | 97 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); |
| 98 | - $this->curlDelRoute($info['url']); | 98 | + $this->curlDelRoute(['route'=>$info['url'],'new_route'=>$route]); |
| 99 | } | 99 | } |
| 100 | return true; | 100 | return true; |
| 101 | } | 101 | } |
| @@ -267,7 +267,7 @@ class NewsLogic extends BaseLogic | @@ -267,7 +267,7 @@ class NewsLogic extends BaseLogic | ||
| 267 | RouteMap::delRoute(RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); | 267 | RouteMap::delRoute(RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); |
| 268 | //生成一条删除路由记录 | 268 | //生成一条删除路由记录 |
| 269 | $info = $this->model->read(['id' => $id], ['id', 'url']); | 269 | $info = $this->model->read(['id' => $id], ['id', 'url']); |
| 270 | - $this->curlDelRoute($info['url']); | 270 | + $this->curlDelRoute(['route'=>$info['url']]); |
| 271 | return $this->success(); | 271 | return $this->success(); |
| 272 | } | 272 | } |
| 273 | 273 |
| @@ -233,7 +233,7 @@ class CategoryLogic extends BaseLogic | @@ -233,7 +233,7 @@ class CategoryLogic extends BaseLogic | ||
| 233 | $info = $this->model->read(['id'=>$id],['id','route']); | 233 | $info = $this->model->read(['id'=>$id],['id','route']); |
| 234 | if($info['route'] != $route){ | 234 | if($info['route'] != $route){ |
| 235 | $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route); | 235 | $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route); |
| 236 | - $this->curlDelRoute($info['route']); | 236 | + $this->curlDelRoute(['route'=>$info['route'],'new_route'=>$route]); |
| 237 | } | 237 | } |
| 238 | return true; | 238 | return true; |
| 239 | } | 239 | } |
| @@ -278,7 +278,7 @@ class CategoryLogic extends BaseLogic | @@ -278,7 +278,7 @@ class CategoryLogic extends BaseLogic | ||
| 278 | RouteMap::delRoute(RouteMap::SOURCE_PRODUCT_CATE, $id, $this->user['project_id']); | 278 | RouteMap::delRoute(RouteMap::SOURCE_PRODUCT_CATE, $id, $this->user['project_id']); |
| 279 | //生成一条删除路由记录 | 279 | //生成一条删除路由记录 |
| 280 | $info = $this->model->read(['id'=>$id],['id','route']); | 280 | $info = $this->model->read(['id'=>$id],['id','route']); |
| 281 | - $this->curlDelRoute($info['route']); | 281 | + $this->curlDelRoute(['route'=>$info['route']]); |
| 282 | return $this->success(); | 282 | return $this->success(); |
| 283 | } | 283 | } |
| 284 | 284 |
| @@ -185,7 +185,7 @@ class KeywordLogic extends BaseLogic | @@ -185,7 +185,7 @@ class KeywordLogic extends BaseLogic | ||
| 185 | RouteMap::delRoute(RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); | 185 | RouteMap::delRoute(RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); |
| 186 | //生成一条删除路由记录 | 186 | //生成一条删除路由记录 |
| 187 | $info = $this->model->read(['id'=>$id],['id','route']); | 187 | $info = $this->model->read(['id'=>$id],['id','route']); |
| 188 | - $this->curlDelRoute($info['route']); | 188 | + $this->curlDelRoute(['route'=>$info['route']]); |
| 189 | return $this->success(); | 189 | return $this->success(); |
| 190 | } | 190 | } |
| 191 | 191 |
| @@ -294,7 +294,7 @@ class ProductLogic extends BaseLogic | @@ -294,7 +294,7 @@ class ProductLogic extends BaseLogic | ||
| 294 | $info = $this->model->read(['id'=>$id]); | 294 | $info = $this->model->read(['id'=>$id]); |
| 295 | if($info['route'] != $route){ | 295 | if($info['route'] != $route){ |
| 296 | $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route); | 296 | $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route); |
| 297 | - $this->curlDelRoute($info['route']); | 297 | + $this->curlDelRoute(['route'=>$info['route'],'new_route'=>$route]); |
| 298 | } | 298 | } |
| 299 | return $route; | 299 | return $route; |
| 300 | } | 300 | } |
| @@ -341,7 +341,7 @@ class ProductLogic extends BaseLogic | @@ -341,7 +341,7 @@ class ProductLogic extends BaseLogic | ||
| 341 | RouteMap::delRoute(RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']); | 341 | RouteMap::delRoute(RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']); |
| 342 | //生成一条删除路由记录 | 342 | //生成一条删除路由记录 |
| 343 | $info = $this->model->read(['id'=>$id],['id','route']); | 343 | $info = $this->model->read(['id'=>$id],['id','route']); |
| 344 | - $this->curlDelRoute($info['route']); | 344 | + $this->curlDelRoute(['route'=>$info['route']]); |
| 345 | return $this->success(); | 345 | return $this->success(); |
| 346 | } | 346 | } |
| 347 | 347 | ||
| @@ -648,6 +648,32 @@ class ProductLogic extends BaseLogic | @@ -648,6 +648,32 @@ class ProductLogic extends BaseLogic | ||
| 648 | 'description' => $data[10]??'' | 648 | 'description' => $data[10]??'' |
| 649 | ]; | 649 | ]; |
| 650 | 650 | ||
| 651 | + //处理描述切换栏 | ||
| 652 | + $describe = []; | ||
| 653 | + if($data[11]){ | ||
| 654 | + //处理描述切换栏中的图片 | ||
| 655 | + $describe = json_decode($data[11],true); | ||
| 656 | + | ||
| 657 | + foreach ($describe as &$v_desc){ | ||
| 658 | + | ||
| 659 | + preg_match_all('/<img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $v_desc['text'], $result_desc); | ||
| 660 | + | ||
| 661 | + if($result_desc[2]??[]){ | ||
| 662 | + foreach ($result_desc[2] as $vdesc_img){ | ||
| 663 | + $v_desc['text'] = str_replace($vdesc_img,getImageUrl(CosService::uploadRemote($project_id,'image_product',$vdesc_img)),$v_desc['text']); | ||
| 664 | + } | ||
| 665 | + } | ||
| 666 | + | ||
| 667 | + //处理描述切换栏中的视频 | ||
| 668 | + preg_match_all('/<source\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $v_desc['text'], $result_desc_video); | ||
| 669 | + if($result_desc_video[2]??[]){ | ||
| 670 | + foreach ($result_desc_video[2] as $vdesc_video){ | ||
| 671 | + $v_desc['text'] = str_replace($vdesc_video,getImageUrl(CosService::uploadRemote($project_id,'image_product',$vdesc_video)),$v_desc['text']); | ||
| 672 | + } | ||
| 673 | + } | ||
| 674 | + } | ||
| 675 | + } | ||
| 676 | + | ||
| 651 | $id = $this->model->addReturnId( | 677 | $id = $this->model->addReturnId( |
| 652 | [ | 678 | [ |
| 653 | 'project_id' => $project_id, | 679 | 'project_id' => $project_id, |
| @@ -659,6 +685,7 @@ class ProductLogic extends BaseLogic | @@ -659,6 +685,7 @@ class ProductLogic extends BaseLogic | ||
| 659 | 'keyword_id' => $keyword_id, | 685 | 'keyword_id' => $keyword_id, |
| 660 | 'intro' => $intro, | 686 | 'intro' => $intro, |
| 661 | 'content' => $content, | 687 | 'content' => $content, |
| 688 | + 'describe' => Arr::a2s($describe), | ||
| 662 | 'seo_mate' => Arr::a2s($seo_mate), | 689 | 'seo_mate' => Arr::a2s($seo_mate), |
| 663 | 'created_uid' => $user_id, | 690 | 'created_uid' => $user_id, |
| 664 | 'status' => Product::STATUS_ON | 691 | 'status' => Product::STATUS_ON |
-
请 注册 或 登录 后发表评论