Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
6 个修改的文件
包含
44 行增加
和
11 行删除
| @@ -834,6 +834,16 @@ function ends_with($string, $suffix) | @@ -834,6 +834,16 @@ function ends_with($string, $suffix) | ||
| 834 | return substr($string, -strlen($suffix)) === $suffix; | 834 | return substr($string, -strlen($suffix)) === $suffix; |
| 835 | } | 835 | } |
| 836 | 836 | ||
| 837 | +function getCustomRouteMap($module_route,$route = '') | ||
| 838 | +{ | ||
| 839 | + if($module_route == $route){ | ||
| 840 | + $resultRoute = $route; | ||
| 841 | + }else{ | ||
| 842 | + $resultRoute = $module_route.'_catelog/'.$route; | ||
| 843 | + } | ||
| 844 | + return $resultRoute; | ||
| 845 | +} | ||
| 846 | + | ||
| 837 | /** | 847 | /** |
| 838 | * @remark :获取二级路由 | 848 | * @remark :获取二级路由 |
| 839 | * @name :getRouteMap | 849 | * @name :getRouteMap |
| @@ -841,11 +851,24 @@ function ends_with($string, $suffix) | @@ -841,11 +851,24 @@ function ends_with($string, $suffix) | ||
| 841 | * @method :post | 851 | * @method :post |
| 842 | * @time :2023/11/10 14:29 | 852 | * @time :2023/11/10 14:29 |
| 843 | */ | 853 | */ |
| 844 | -function getRouteMap($source,$source_id){ | 854 | +function getRouteMap($source,$source_id,$is_upgrade = 0){ |
| 845 | $route = ''; | 855 | $route = ''; |
| 846 | $routeMapModel = new RouteMap(); | 856 | $routeMapModel = new RouteMap(); |
| 847 | $info = $routeMapModel->read(['source'=>$source,'source_id'=>$source_id]); | 857 | $info = $routeMapModel->read(['source'=>$source,'source_id'=>$source_id]); |
| 848 | if($info !== false){ | 858 | if($info !== false){ |
| 859 | + if($is_upgrade == 1){ | ||
| 860 | + if($source == $routeMapModel::SOURCE_NEWS_CATE){ | ||
| 861 | + if($info['route'] != 'news'){ | ||
| 862 | + return $routeMapModel::PATH_NEWS_CATE.'/'.$info['route']; | ||
| 863 | + } | ||
| 864 | + }elseif ($source == $routeMapModel::SOURCE_BLOG_CATE){ | ||
| 865 | + if($info['route'] != 'blog'){ | ||
| 866 | + return $routeMapModel::PATH_BLOG_CATE.'/'.$info['route']; | ||
| 867 | + } | ||
| 868 | + } | ||
| 869 | + $route = $info['route']; | ||
| 870 | + return $route; | ||
| 871 | + } | ||
| 849 | if(!empty($info['path'])){ | 872 | if(!empty($info['path'])){ |
| 850 | if($info['path'] == 'blog'){ | 873 | if($info['path'] == 'blog'){ |
| 851 | $info['path'] = $info['path'].'s'; | 874 | $info['path'] = $info['path'].'s'; |
| @@ -29,7 +29,7 @@ class BlogCategoryController extends BaseController | @@ -29,7 +29,7 @@ class BlogCategoryController extends BaseController | ||
| 29 | $template_id = $this->getTemplateId(BTemplate::SOURCE_BLOG,BTemplate::IS_LIST); | 29 | $template_id = $this->getTemplateId(BTemplate::SOURCE_BLOG,BTemplate::IS_LIST); |
| 30 | foreach ($lists as $k => $v){ | 30 | foreach ($lists as $k => $v){ |
| 31 | $v['num'] = $blogModel->formatQuery(['category_id'=>['like','%,' . $v['id'] . ',%']])->count(); | 31 | $v['num'] = $blogModel->formatQuery(['category_id'=>['like','%,' . $v['id'] . ',%']])->count(); |
| 32 | - $v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_BLOG_CATE,$v['id']); | 32 | + $v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_BLOG_CATE,$v['id'],$this->user['is_upgrade']); |
| 33 | $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_LIST,$template_id,$v['id']); | 33 | $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_LIST,$template_id,$v['id']); |
| 34 | $lists[$k] = $v; | 34 | $lists[$k] = $v; |
| 35 | } | 35 | } |
| @@ -42,12 +42,7 @@ class CustomModuleCategoryController extends BaseController | @@ -42,12 +42,7 @@ class CustomModuleCategoryController extends BaseController | ||
| 42 | $template_id = $this->getModuleTemplateId($this->param['module_id']); | 42 | $template_id = $this->getModuleTemplateId($this->param['module_id']); |
| 43 | foreach ($list as $k => $v){ | 43 | foreach ($list as $k => $v){ |
| 44 | $v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM); | 44 | $v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM); |
| 45 | - $v['url'] = $this->user['domain'].$v['route']; | ||
| 46 | - if($this->user['is_upgrade'] == 1){ | ||
| 47 | - if($v['route'] != $moduleInfo['route']){ | ||
| 48 | - $v['url'] = $this->user['domain'].$moduleInfo['route']."_catalog/".$v['route']; | ||
| 49 | - } | ||
| 50 | - } | 45 | + $v['url'] = $this->user['domain'].getCustomRouteMap($moduleInfo['route'],$v['route']); |
| 51 | $list[$k] = $v; | 46 | $list[$k] = $v; |
| 52 | } | 47 | } |
| 53 | } | 48 | } |
| @@ -37,7 +37,7 @@ class GoogleSearchController extends BaseController | @@ -37,7 +37,7 @@ class GoogleSearchController extends BaseController | ||
| 37 | //查询详情数据 | 37 | //查询详情数据 |
| 38 | $searchDetailModel = new GoogleSearchDetail(); | 38 | $searchDetailModel = new GoogleSearchDetail(); |
| 39 | $this->map['project_id'] = $this->user['project_id']; | 39 | $this->map['project_id'] = $this->user['project_id']; |
| 40 | - $data = $searchDetailModel->lists($this->map,$this->page,$this->row,'impressions',['keys','click_rate','impressions_rate']); | 40 | + $data = $searchDetailModel->lists($this->map,$this->page,$this->row,'impressions',['keys','click_rate','position','impressions_rate']); |
| 41 | if(!empty($data)){ | 41 | if(!empty($data)){ |
| 42 | if($this->param['type'] == 'country'){ | 42 | if($this->param['type'] == 'country'){ |
| 43 | $codeCountryModel = new GoogleCodeCountry(); | 43 | $codeCountryModel = new GoogleCodeCountry(); |
| @@ -29,7 +29,7 @@ class NewsCategoryController extends BaseController | @@ -29,7 +29,7 @@ class NewsCategoryController extends BaseController | ||
| 29 | $template_id = $this->getTemplateId(BTemplate::SOURCE_BLOG,BTemplate::IS_LIST); | 29 | $template_id = $this->getTemplateId(BTemplate::SOURCE_BLOG,BTemplate::IS_LIST); |
| 30 | foreach ($lists as $k => $v){ | 30 | foreach ($lists as $k => $v){ |
| 31 | $v['num'] = $newsModel->formatQuery(['category_id'=>['like','%,' . $v['id'] . ',%']])->count(); | 31 | $v['num'] = $newsModel->formatQuery(['category_id'=>['like','%,' . $v['id'] . ',%']])->count(); |
| 32 | - $v['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS_CATE,$v['id']); | 32 | + $v['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS_CATE,$v['id'],$this->user['is_upgrade']); |
| 33 | $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_LIST,$template_id,$v['id']); | 33 | $v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_LIST,$template_id,$v['id']); |
| 34 | $lists[$k] = $v; | 34 | $lists[$k] = $v; |
| 35 | } | 35 | } |
| @@ -200,7 +200,22 @@ class DomainInfoLogic extends BaseLogic | @@ -200,7 +200,22 @@ class DomainInfoLogic extends BaseLogic | ||
| 200 | $host_array = explode('.',$host); | 200 | $host_array = explode('.',$host); |
| 201 | 201 | ||
| 202 | if($this->param['type'] == 3){ | 202 | if($this->param['type'] == 3){ |
| 203 | - //需要申请通配符证书,判断_acme-challenge是否已经解析 | 203 | + //需要申请通配符证书 |
| 204 | + | ||
| 205 | + //判断*是否已经解析 | ||
| 206 | + $host_array_any = $host_array; | ||
| 207 | + if (count($host_array_any) <= 2) { | ||
| 208 | + array_unshift($host_array_any, '*'); | ||
| 209 | + } else { | ||
| 210 | + $host_array_any[0] = '*'; | ||
| 211 | + } | ||
| 212 | + $any_domain = implode('.',$host_array_any); | ||
| 213 | + $rand_str = generateRandomString(3); | ||
| 214 | + if(!check_domain_record(str_replace('*',$rand_str,$any_domain), $serversIpInfo)){ | ||
| 215 | + $this->fail('域名' . $any_domain . '未解析至目标服务器'); | ||
| 216 | + } | ||
| 217 | + | ||
| 218 | + //判断_acme-challenge是否已经解析 | ||
| 204 | $host_array_ssl = $host_array; | 219 | $host_array_ssl = $host_array; |
| 205 | if (count($host_array_ssl) <= 2) { | 220 | if (count($host_array_ssl) <= 2) { |
| 206 | array_unshift($host_array_ssl, '_acme-challenge'); | 221 | array_unshift($host_array_ssl, '_acme-challenge'); |
-
请 注册 或 登录 后发表评论