作者 赵彬吉
... ... @@ -834,6 +834,16 @@ function ends_with($string, $suffix)
return substr($string, -strlen($suffix)) === $suffix;
}
function getCustomRouteMap($module_route,$route = '')
{
if($module_route == $route){
$resultRoute = $route;
}else{
$resultRoute = $module_route.'_catelog/'.$route;
}
return $resultRoute;
}
/**
* @remark :获取二级路由
* @name :getRouteMap
... ... @@ -841,11 +851,24 @@ function ends_with($string, $suffix)
* @method :post
* @time :2023/11/10 14:29
*/
function getRouteMap($source,$source_id){
function getRouteMap($source,$source_id,$is_upgrade = 0){
$route = '';
$routeMapModel = new RouteMap();
$info = $routeMapModel->read(['source'=>$source,'source_id'=>$source_id]);
if($info !== false){
if($is_upgrade == 1){
if($source == $routeMapModel::SOURCE_NEWS_CATE){
if($info['route'] != 'news'){
return $routeMapModel::PATH_NEWS_CATE.'/'.$info['route'];
}
}elseif ($source == $routeMapModel::SOURCE_BLOG_CATE){
if($info['route'] != 'blog'){
return $routeMapModel::PATH_BLOG_CATE.'/'.$info['route'];
}
}
$route = $info['route'];
return $route;
}
if(!empty($info['path'])){
if($info['path'] == 'blog'){
$info['path'] = $info['path'].'s';
... ...
... ... @@ -29,7 +29,7 @@ class BlogCategoryController extends BaseController
$template_id = $this->getTemplateId(BTemplate::SOURCE_BLOG,BTemplate::IS_LIST);
foreach ($lists as $k => $v){
$v['num'] = $blogModel->formatQuery(['category_id'=>['like','%,' . $v['id'] . ',%']])->count();
$v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_BLOG_CATE,$v['id']);
$v['url'] = $this->user['domain'] . getRouteMap(RouteMap::SOURCE_BLOG_CATE,$v['id'],$this->user['is_upgrade']);
$v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_BLOG,BTemplate::IS_LIST,$template_id,$v['id']);
$lists[$k] = $v;
}
... ...
... ... @@ -42,12 +42,7 @@ class CustomModuleCategoryController extends BaseController
$template_id = $this->getModuleTemplateId($this->param['module_id']);
foreach ($list as $k => $v){
$v['is_renovation'] = $this->getIsRenovation($v['module_id'],BTemplate::IS_LIST,$template_id,$v['id'],BTemplate::IS_CUSTOM);
$v['url'] = $this->user['domain'].$v['route'];
if($this->user['is_upgrade'] == 1){
if($v['route'] != $moduleInfo['route']){
$v['url'] = $this->user['domain'].$moduleInfo['route']."_catalog/".$v['route'];
}
}
$v['url'] = $this->user['domain'].getCustomRouteMap($moduleInfo['route'],$v['route']);
$list[$k] = $v;
}
}
... ...
... ... @@ -37,7 +37,7 @@ class GoogleSearchController extends BaseController
//查询详情数据
$searchDetailModel = new GoogleSearchDetail();
$this->map['project_id'] = $this->user['project_id'];
$data = $searchDetailModel->lists($this->map,$this->page,$this->row,'impressions',['keys','click_rate','impressions_rate']);
$data = $searchDetailModel->lists($this->map,$this->page,$this->row,'impressions',['keys','click_rate','position','impressions_rate']);
if(!empty($data)){
if($this->param['type'] == 'country'){
$codeCountryModel = new GoogleCodeCountry();
... ...
... ... @@ -29,7 +29,7 @@ class NewsCategoryController extends BaseController
$template_id = $this->getTemplateId(BTemplate::SOURCE_BLOG,BTemplate::IS_LIST);
foreach ($lists as $k => $v){
$v['num'] = $newsModel->formatQuery(['category_id'=>['like','%,' . $v['id'] . ',%']])->count();
$v['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS_CATE,$v['id']);
$v['url'] = $this->user['domain'].getRouteMap(RouteMap::SOURCE_NEWS_CATE,$v['id'],$this->user['is_upgrade']);
$v['is_renovation'] = $this->getIsRenovation(BTemplate::SOURCE_NEWS,BTemplate::IS_LIST,$template_id,$v['id']);
$lists[$k] = $v;
}
... ...
... ... @@ -200,7 +200,22 @@ class DomainInfoLogic extends BaseLogic
$host_array = explode('.',$host);
if($this->param['type'] == 3){
//需要申请通配符证书,判断_acme-challenge是否已经解析
//需要申请通配符证书
//判断*是否已经解析
$host_array_any = $host_array;
if (count($host_array_any) <= 2) {
array_unshift($host_array_any, '*');
} else {
$host_array_any[0] = '*';
}
$any_domain = implode('.',$host_array_any);
$rand_str = generateRandomString(3);
if(!check_domain_record(str_replace('*',$rand_str,$any_domain), $serversIpInfo)){
$this->fail('域名' . $any_domain . '未解析至目标服务器');
}
//判断_acme-challenge是否已经解析
$host_array_ssl = $host_array;
if (count($host_array_ssl) <= 2) {
array_unshift($host_array_ssl, '_acme-challenge');
... ...