Merge remote-tracking branch 'origin/master' into akun
正在显示
5 个修改的文件
包含
30 行增加
和
7 行删除
| @@ -545,7 +545,7 @@ class BTemplateLogic extends BaseLogic | @@ -545,7 +545,7 @@ class BTemplateLogic extends BaseLogic | ||
| 545 | public function homeOrProduct($source,$source_id = 0,$is_custom = 0){ | 545 | public function homeOrProduct($source,$source_id = 0,$is_custom = 0){ |
| 546 | if($is_custom == 0){ | 546 | if($is_custom == 0){ |
| 547 | if($source == BTemplate::SOURCE_HOME){ | 547 | if($source == BTemplate::SOURCE_HOME){ |
| 548 | - $route = RouteMap::setRoute('index', RouteMap::SOURCE_PAGE, 0, $this->user['project_id']); | 548 | + RouteMap::setRoute('index', RouteMap::SOURCE_PAGE, 0, $this->user['project_id']); |
| 549 | $type = RouteMap::SOURCE_PAGE; | 549 | $type = RouteMap::SOURCE_PAGE; |
| 550 | }elseif($source == BTemplate::SOURCE_PRODUCT){ | 550 | }elseif($source == BTemplate::SOURCE_PRODUCT){ |
| 551 | $type = RouteMap::SOURCE_PRODUCT; | 551 | $type = RouteMap::SOURCE_PRODUCT; |
| @@ -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 | } |
| @@ -65,8 +65,8 @@ class CountLogic extends BaseLogic | @@ -65,8 +65,8 @@ class CountLogic extends BaseLogic | ||
| 65 | * @time :2023/5/24 13:33 | 65 | * @time :2023/5/24 13:33 |
| 66 | */ | 66 | */ |
| 67 | public function total_count($inquiry_num = ''){ | 67 | public function total_count($inquiry_num = ''){ |
| 68 | - $pv = (new VisitItem())->where(['domain'=>$this->user['domain']])->count(); | ||
| 69 | - $ip = (new Visit())->where(['domain'=>$this->user['domain']])->count(); | 68 | + $pv = (new VisitItem())->count(); |
| 69 | + $ip = (new Visit())->count(); | ||
| 70 | $data = [ | 70 | $data = [ |
| 71 | 'total_pv'=>$pv, | 71 | 'total_pv'=>$pv, |
| 72 | 'total_ip'=>$ip, | 72 | 'total_ip'=>$ip, |
| @@ -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(); |
-
请 注册 或 登录 后发表评论