作者 lyh

gx

... ... @@ -162,56 +162,58 @@ class BTemplateLogic extends BaseLogic
//获取首页公共的头部和底部
$commonTemplateModel = new BTemplateCommon();
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>1]);
//查看页面是否设置自定义头部底部
$pageSettingModel = new PageSetting();
$pageInfo = $pageSettingModel->read(['project_id'=>$this->user['project_id']]);
if($pageInfo != false){
$commonTemplateModel = new BTemplateCommon();
if($source == 2){//产品页
if($source_id != 0){//产品详情页
if($pageInfo['product_list'] != 0){
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>3]);
}
}else{//产品列表页
if($pageInfo['product_details'] != 0){
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>2]);
if(isset($this->user['configuration']['is_head']) && ($this->user['configuration']['is_head'] != 0)) {
//查看页面是否设置自定义头部底部
$pageSettingModel = new PageSetting();
$pageInfo = $pageSettingModel->read(['project_id' => $this->user['project_id']]);
if ($pageInfo != false) {
$commonTemplateModel = new BTemplateCommon();
if ($source == 2) {//产品页
if ($source_id != 0) {//产品详情页
if ($pageInfo['product_list'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 3]);
}
} else {//产品列表页
if ($pageInfo['product_details'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 2]);
}
}
}
}
if($source == 3){//博客页
if($source_id != 0){//博客详情页
if($pageInfo['blog_lists'] != 0){
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>4]);
}
}else{//产品列表页
if($pageInfo['blog_details'] != 0){
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>5]);
if ($source == 3) {//博客页
if ($source_id != 0) {//博客详情页
if ($pageInfo['blog_lists'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 4]);
}
} else {//产品列表页
if ($pageInfo['blog_details'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 5]);
}
}
}
}
if($source == 4){//新闻页
if($source_id != 0){//新闻详情页
if($pageInfo['news_lists'] != 0){
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>6]);
if ($source == 4) {//新闻页
if ($source_id != 0) {//新闻详情页
if ($pageInfo['news_lists'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 6]);
}
} else {//新闻列表页
if ($pageInfo['news_details'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 7]);
}
}
}else{//新闻列表页
if($pageInfo['news_details'] != 0){
}
if ($source == 5) {//聚合页
if ($pageInfo['polymerization'] != 0) {
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>7]);
$commonInfo = $commonTemplateModel->read(['template_id' => $template_id, 'project_id' => $this->user['project_id'], 'type' => 8]);
}
}
}
if($source == 5){//聚合页
if($pageInfo['polymerization'] != 0){
//使用独立头和底
$commonInfo = $commonTemplateModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>8]);
}
}
}
return $commonInfo;
}
... ... @@ -319,45 +321,47 @@ class BTemplateLogic extends BaseLogic
public function getType($source,$source_id){
$type = 1;//首页公共头部底部
//查看页面是否设置自定义头部底部
$pageSettingModel = new PageSetting();
$pageInfo = $pageSettingModel->read(['project_id'=>$this->user['project_id']]);
if($pageInfo !== false){
if($source == 2){
if($source_id != 0){
if($pageInfo['product_list'] != 0){
$type = 3;
}
}else{
if($pageInfo['product_details'] != 0){
$type = 2;
if(isset($this->user['configuration']['is_head']) && ($this->user['configuration']['is_head'] != 0)) {
$pageSettingModel = new PageSetting();
$pageInfo = $pageSettingModel->read(['project_id' => $this->user['project_id']]);
if ($pageInfo !== false) {
if ($source == 2) {
if ($source_id != 0) {
if ($pageInfo['product_list'] != 0) {
$type = 3;
}
} else {
if ($pageInfo['product_details'] != 0) {
$type = 2;
}
}
}
}
if($source == 3){
if($source_id != 0){
if($pageInfo['blog_list'] != 0){
$type = 4;
}
}else{
if($pageInfo['blog_details'] != 0){
$type = 5;
if ($source == 3) {
if ($source_id != 0) {
if ($pageInfo['blog_list'] != 0) {
$type = 4;
}
} else {
if ($pageInfo['blog_details'] != 0) {
$type = 5;
}
}
}
}
if($source == 4){
if($source_id != 0){
if($pageInfo['news_list'] != 0){
$type = 6;
}
}else{
if($pageInfo['news_details'] != 0){
$type = 7;
if ($source == 4) {
if ($source_id != 0) {
if ($pageInfo['news_list'] != 0) {
$type = 6;
}
} else {
if ($pageInfo['news_details'] != 0) {
$type = 7;
}
}
}
}
if($source == 5){
if($pageInfo['polymerization'] != 0){
$type = 8;
if ($source == 5) {
if ($pageInfo['polymerization'] != 0) {
$type = 8;
}
}
}
}
... ...
... ... @@ -226,7 +226,7 @@ class CustomTemplateLogic extends BaseLogic
}
$commonTemplateModel = new BTemplateCommon();
$commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id']]);
$commonInfo = $commonTemplateModel->read(['template_id'=>$info['template_id'],'project_id'=>$this->user['project_id'],'type'=>1]);
$html = '';
if($commonInfo !== false){
$html = $commonInfo['head_css'].$html_style.$commonInfo['footer_css'].$commonInfo['other'].
... ...
... ... @@ -86,10 +86,10 @@ class KeywordLogic extends BaseLogic
*/
public function handleSaveParam($param){
if(isset($param['keyword_top_banner']) && !empty($param['keyword_top_banner'])){
$param['keyword_top_banner'] = Arr::a2s($param['keyword_top_banner']);
$param['keyword_top_banner'] = str_replace_url($param['keyword_top_banner']);
}
if(isset($param['keyword_foot_banner']) && !empty($param['keyword_foot_banner'])){
$param['keyword_foot_banner'] = Arr::a2s($param['keyword_foot_banner']);
$param['keyword_foot_banner'] = str_replace_url($param['keyword_foot_banner']);
}
return $param;
}
... ...