作者 lyh

gx

... ... @@ -120,7 +120,7 @@ class BTemplateLogic extends BaseLogic
}
/**
* @remark :处理产品页数据
* @remark :处理其他页数据
* @name :ProductHtml
* @author :lyh
* @method :post
... ... @@ -134,8 +134,9 @@ class BTemplateLogic extends BaseLogic
//查看当前模板是否已编辑保存web_template
$TemplateInfo = $this->webTemplateInfo($info['template_id'],$source,$source_id);
if($TemplateInfo === false){
$main_html = "<main>{$this->getProductModule()}</main>";
$main_style = "<style id='globalsojs-styles'></style>";
$mainInfo = $this->getCommonMain($source,$source_id);
$main_html = $mainInfo['main_html'];
$main_style = $mainInfo['main_css'];
}else{
$main_html = $TemplateInfo['main_html'];
$main_style = $TemplateInfo['main_css'];
... ... @@ -153,6 +154,31 @@ class BTemplateLogic extends BaseLogic
}
/**
* @remark :获取中间公共部分
* @name :getCommonMain
* @author :lyh
* @method :post
* @time :2023/10/24 15:58
*/
public function getCommonMain($source,$source_id){
$data = [];
if ($source == 2) {if ($source_id != 0) {$type = 2;} else {$type = 3;}}
if ($source == 3) {if ($source_id != 0) {$type = 4;} else {$type = 5;}}
if ($source == 4) {if ($source_id != 0) {$type = 6;} else {$type = 7;}}
//查询有没有公共模板详情样式
$bTemplateMainModel = new BTemplateMain();
$mainInfo = $bTemplateMainModel->read(['project_id'=>$this->user['project_id'],'type'=>$type]);
if($mainInfo === false){
$data['main_html'] = "<main>{$this->getProductModule()}</main>";
$data['main_css'] = "<style id='globalsojs-styles'></style>";
}else{
$data['main_html'] = $mainInfo['main_html'];
$data['main_css'] = $mainInfo['main_css'];
}
return $data;
}
/**
* @remark :根据类型获取公共头和底
* @name :getCommonPage
* @author :lyh
... ... @@ -180,8 +206,7 @@ class BTemplateLogic extends BaseLogic
if ($source_id != 0) {$data['type'] = 6;if ($pageInfo['news_details'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}
else {$data['type'] = 7;if ($pageInfo['news_lists'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}}
if ($source == 5) {//聚合页
$data['type'] = 8;
if ($pageInfo['polymerization'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}
$data['type'] = 8;if ($pageInfo['polymerization'] != 0) {$commonInfo = $commonTemplateModel->read($data);}}
}
}
//获取首页公共的头部和底部
... ...