作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

@@ -255,13 +255,17 @@ class HtmlCollect extends Command @@ -255,13 +255,17 @@ class HtmlCollect extends Command
255 $query = $arr['query'] ?? ''; 255 $query = $arr['query'] ?? '';
256 256
257 $path_arr = explode('.', $path); 257 $path_arr = explode('.', $path);
  258 + $path_end = end($path_arr);
258 if ( 259 if (
259 (empty($scheme) || $scheme == 'https' || $scheme == 'http') 260 (empty($scheme) || $scheme == 'https' || $scheme == 'http')
260 && (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false)) 261 && (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false))
261 && $path 262 && $path
262 && (substr($path, 0, 1) == '/') 263 && (substr($path, 0, 1) == '/')
263 && (strpos($path, '.') !== false) 264 && (strpos($path, '.') !== false)
264 - && (!in_array(end($path_arr), ['html', 'php', 'com', 'xml'])) 265 + && (strpos($path_end, 'html') === false)
  266 + && (strpos($path_end, 'php') === false)
  267 + && (strpos($path_end, 'com') === false)
  268 + && (strpos($path_end, 'xml') === false)
265 ) { 269 ) {
266 $source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first(); 270 $source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
267 if (!$source) { 271 if (!$source) {
@@ -255,13 +255,17 @@ class HtmlLanguageCollect extends Command @@ -255,13 +255,17 @@ class HtmlLanguageCollect extends Command
255 $query = $arr['query'] ?? ''; 255 $query = $arr['query'] ?? '';
256 256
257 $path_arr = explode('.', $path); 257 $path_arr = explode('.', $path);
  258 + $path_end = end($path_arr);
258 if ( 259 if (
259 (empty($scheme) || $scheme == 'https' || $scheme == 'http') 260 (empty($scheme) || $scheme == 'https' || $scheme == 'http')
260 && (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false)) 261 && (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false))
261 && $path 262 && $path
262 && (substr($path, 0, 1) == '/') 263 && (substr($path, 0, 1) == '/')
263 && (strpos($path, '.') !== false) 264 && (strpos($path, '.') !== false)
264 - && (!in_array(end($path_arr), ['html', 'php', 'com', 'xml'])) 265 + && (strpos($path_end, 'html') === false)
  266 + && (strpos($path_end, 'php') === false)
  267 + && (strpos($path_end, 'com') === false)
  268 + && (strpos($path_end, 'xml') === false)
265 ) { 269 ) {
266 $source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first(); 270 $source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
267 if (!$source) { 271 if (!$source) {
@@ -299,7 +299,9 @@ class CustomModuleContentLogic extends BaseLogic @@ -299,7 +299,9 @@ class CustomModuleContentLogic extends BaseLogic
299 DB::beginTransaction(); 299 DB::beginTransaction();
300 try { 300 try {
301 foreach ($this->param['id'] as $id) { 301 foreach ($this->param['id'] as $id) {
  302 + //删除当前扩展字段
302 $this->delRoute($id); 303 $this->delRoute($id);
  304 + $this->delContentExtend($id);
303 $this->model->del(['id' => $id]); 305 $this->model->del(['id' => $id]);
304 } 306 }
305 DB::commit(); 307 DB::commit();
@@ -337,4 +339,17 @@ class CustomModuleContentLogic extends BaseLogic @@ -337,4 +339,17 @@ class CustomModuleContentLogic extends BaseLogic
337 $this->model->edit(['sort' => $this->param['sort']], ['id'=>$this->param['id']]); 339 $this->model->edit(['sort' => $this->param['sort']], ['id'=>$this->param['id']]);
338 return $this->success(); 340 return $this->success();
339 } 341 }
  342 +
  343 + /**
  344 + * @remark :
  345 + * @name :delContentExtend
  346 + * @author :lyh
  347 + * @method :post
  348 + * @time :2023/12/18 11:43
  349 + */
  350 + public function delContentExtend($id){
  351 + $contentExtendModel = new CustomModuleExtentContent();
  352 + $contentExtendModel->del(['content_id'=>$id]);
  353 + return $this->success();
  354 + }
340 } 355 }
@@ -66,7 +66,7 @@ class KeywordLogic extends BaseLogic @@ -66,7 +66,7 @@ class KeywordLogic extends BaseLogic
66 $route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); 66 $route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
67 $this->model->edit(['route'=>$route],['id'=>$id]); 67 $this->model->edit(['route'=>$route],['id'=>$id]);
68 } 68 }
69 - //清除缓存 69 +// //清除缓存
70 Common::del_user_cache('product_keyword',$this->user['project_id']); 70 Common::del_user_cache('product_keyword',$this->user['project_id']);
71 DB::commit(); 71 DB::commit();
72 }catch (\Exception $e){ 72 }catch (\Exception $e){
@@ -102,18 +102,28 @@ class KeywordLogic extends BaseLogic @@ -102,18 +102,28 @@ class KeywordLogic extends BaseLogic
102 public function handleSaveParam($param){ 102 public function handleSaveParam($param){
103 if(isset($param['keyword_top_banner']) && !empty($param['keyword_top_banner'])){ 103 if(isset($param['keyword_top_banner']) && !empty($param['keyword_top_banner'])){
104 $param['keyword_top_banner'] = str_replace_url($param['keyword_top_banner']); 104 $param['keyword_top_banner'] = str_replace_url($param['keyword_top_banner']);
  105 + }else{
  106 + unset($param['keyword_top_banner']);
105 } 107 }
106 if(isset($param['keyword_foot_banner']) && !empty($param['keyword_foot_banner'])){ 108 if(isset($param['keyword_foot_banner']) && !empty($param['keyword_foot_banner'])){
107 $param['keyword_foot_banner'] = str_replace_url($param['keyword_foot_banner']); 109 $param['keyword_foot_banner'] = str_replace_url($param['keyword_foot_banner']);
  110 + }else{
  111 + unset($param['keyword_foot_banner']);
108 } 112 }
109 if(isset($param['keyword_video']) && !empty($param['keyword_video'])){ 113 if(isset($param['keyword_video']) && !empty($param['keyword_video'])){
110 $param['keyword_video'] = Arr::a2s($param['keyword_video']); 114 $param['keyword_video'] = Arr::a2s($param['keyword_video']);
  115 + }else{
  116 + unset($param['keyword_video']);
111 } 117 }
112 if(!empty($param['related_news_ids'])){ 118 if(!empty($param['related_news_ids'])){
113 $param['related_news_ids'] = Arr::arrToSet($param['related_news_ids']); 119 $param['related_news_ids'] = Arr::arrToSet($param['related_news_ids']);
  120 + }else{
  121 + unset($param['related_news_ids']);
114 } 122 }
115 if(!empty($param['related_blog_ids'])){ 123 if(!empty($param['related_blog_ids'])){
116 $param['related_blog_ids'] = Arr::arrToSet($param['related_blog_ids']); 124 $param['related_blog_ids'] = Arr::arrToSet($param['related_blog_ids']);
  125 + }else{
  126 + unset($param['related_blog_ids']);
117 } 127 }
118 return $param; 128 return $param;
119 } 129 }
@@ -54,9 +54,7 @@ class RouteMap extends Base @@ -54,9 +54,7 @@ class RouteMap extends Base
54 * @date 2023/4/17 54 * @date 2023/4/17
55 */ 55 */
56 public static function generateRoute($title, $source, $source_id, $project_id){ 56 public static function generateRoute($title, $source, $source_id, $project_id){
57 - if(!preg_match('/^[a-zA-Z]$/', $title)){  
58 - $title = Translate::tran($title, 'en');  
59 - } 57 + $title = Translate::tran($title, 'en');
60 $i=1; 58 $i=1;
61 $sign = generateRoute($title); 59 $sign = generateRoute($title);
62 $info = self::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first(); 60 $info = self::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first();