作者 lyh

gx

@@ -81,7 +81,7 @@ class BTemplateLogic extends BaseLogic @@ -81,7 +81,7 @@ class BTemplateLogic extends BaseLogic
81 $html = $this->isCustomizedPage($source,$source_id);//查看当前页面是否定制 81 $html = $this->isCustomizedPage($source,$source_id);//查看当前页面是否定制
82 return $this->success(['html'=>$html,'template_id'=>$template_id]); 82 return $this->success(['html'=>$html,'template_id'=>$template_id]);
83 } 83 }
84 - $mainInfo = $this->getCommonMain($source,$source_id);//获取中间部分代码 84 + $mainInfo = $this->getCommonMain($source,$source_id,$is_custom);//获取中间部分代码
85 }else{ 85 }else{
86 $mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']]; 86 $mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']];
87 } 87 }
@@ -210,12 +210,16 @@ class BTemplateLogic extends BaseLogic @@ -210,12 +210,16 @@ class BTemplateLogic extends BaseLogic
210 * @method :post 210 * @method :post
211 * @time :2023/10/24 15:58 211 * @time :2023/10/24 15:58
212 */ 212 */
213 - public function getCommonMain($source,$source_id){ 213 + public function getCommonMain($source,$source_id,$is_custom){
214 $data = []; 214 $data = [];
215 - if ($source == BTemplate::SOURCE_PRODUCT) {if ($source_id != 0) {$type = BTemplate::TYPE_TWO;} else {$type = BTemplate::TYPE_THREE;}}  
216 - if ($source == BTemplate::SOURCE_BLOG) {if ($source_id != 0) {$type = BTemplate::TYPE_FOUR;} else {$type = BTemplate::TYPE_FIVE;}}  
217 - if ($source == BTemplate::SOURCE_NEWS) {if ($source_id != 0) {$type = BTemplate::TYPE_SIX;} else {$type = BTemplate::TYPE_SEVEN;}}  
218 - if ($source == BTemplate::SOURCE_KEYWORD) {$type = BTemplate::TYPE_EIGHT;} 215 + if($is_custom == BTemplate::SOURCE_CUSTOM){
  216 + if($source_id != 0){$type = BTemplate::TYPE_SIX;}else{$type = BTemplate::TYPE_SEVEN;}
  217 + }else{
  218 + if ($source == BTemplate::SOURCE_PRODUCT) {if ($source_id != 0) {$type = BTemplate::TYPE_TWO;} else {$type = BTemplate::TYPE_THREE;}}
  219 + if ($source == BTemplate::SOURCE_BLOG) {if ($source_id != 0) {$type = BTemplate::TYPE_FOUR;} else {$type = BTemplate::TYPE_FIVE;}}
  220 + if ($source == BTemplate::SOURCE_NEWS) {if ($source_id != 0) {$type = BTemplate::TYPE_SIX;} else {$type = BTemplate::TYPE_SEVEN;}}
  221 + if ($source == BTemplate::SOURCE_KEYWORD) {$type = BTemplate::TYPE_EIGHT;}
  222 + }
219 //查询有没有公共详情模板 223 //查询有没有公共详情模板
220 $bTemplateMainModel = new BTemplateMain(); 224 $bTemplateMainModel = new BTemplateMain();
221 $mainInfo = $bTemplateMainModel->read(['project_id'=>$this->user['project_id'],'type'=>$type]); 225 $mainInfo = $bTemplateMainModel->read(['project_id'=>$this->user['project_id'],'type'=>$type]);