|
...
|
...
|
@@ -73,7 +73,7 @@ class BTemplateLogic extends BaseLogic |
|
|
|
'is_custom'=>$is_custom, 'is_list'=>$is_list
|
|
|
|
]);
|
|
|
|
if($templateInfo === false){
|
|
|
|
if($this->user['is_customized'] == BTemplate::SOURCE_VISUALIZATION){//处理定制页面初始数据
|
|
|
|
if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//处理定制页面初始数据
|
|
|
|
$html = $this->isCustomizedPage($this->param['source'],$is_list);//获取定制页面的html
|
|
|
|
return $this->success(['html'=>$html,'template_id'=>$template_id]);
|
|
|
|
}
|
|
...
|
...
|
@@ -128,8 +128,8 @@ class BTemplateLogic extends BaseLogic |
|
|
|
* @time :2023/7/27 15:08
|
|
|
|
*/
|
|
|
|
public function getInitModule($type,$is_custom,$is_list){
|
|
|
|
if($is_custom == BTemplate::SOURCE_CUSTOM) {
|
|
|
|
$type = BTemplate::TYPE_CUSTOM;
|
|
|
|
if($is_custom == BTemplate::IS_CUSTOM) {
|
|
|
|
$type = BTemplate::SOURCE_CUSTOM;
|
|
|
|
}
|
|
|
|
$mainModel = new TemplateTypeMain();
|
|
|
|
$info = $mainModel->read(['type'=>$type,'is_list'=>$is_list]);
|
|
...
|
...
|
@@ -189,26 +189,26 @@ class BTemplateLogic extends BaseLogic |
|
|
|
* @time :2023/11/16 11:20
|
|
|
|
*/
|
|
|
|
public function getCustomizedType($source,$is_list){
|
|
|
|
$type = BTemplate::TYPE_ONE;
|
|
|
|
$type = BTemplate::TYPE_HOME;
|
|
|
|
if($source == BTemplate::SOURCE_PRODUCT){
|
|
|
|
if($is_list == BTemplate::IS_LIST){
|
|
|
|
$type = BTemplate::TYPE_THREE;
|
|
|
|
$type = BTemplate::TYPE_PRODUCT_LIST;
|
|
|
|
}else{
|
|
|
|
$type = BTemplate::TYPE_TWO;
|
|
|
|
$type = BTemplate::TYPE_PRODUCT_DETAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($source == BTemplate::SOURCE_BLOG){
|
|
|
|
if($is_list == BTemplate::IS_LIST){
|
|
|
|
$type = BTemplate::TYPE_FIVE;
|
|
|
|
$type = BTemplate::TYPE_BLOG_LIST;
|
|
|
|
}else{
|
|
|
|
$type = BTemplate::TYPE_FOUR;
|
|
|
|
$type = BTemplate::TYPE_BLOG_DETAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($source == BTemplate::SOURCE_NEWS){
|
|
|
|
if($is_list == BTemplate::IS_LIST){
|
|
|
|
$type = BTemplate::TYPE_SEVEN;
|
|
|
|
$type = BTemplate::TYPE_NEWS_LIST;
|
|
|
|
}else{
|
|
|
|
$type = BTemplate::TYPE_SIX;
|
|
|
|
$type = BTemplate::TYPE_NEWS_DETAIL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $type;
|
|
...
|
...
|
@@ -223,7 +223,7 @@ class BTemplateLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function getSettingTemplate($source,$is_list){
|
|
|
|
$template_id = 0;
|
|
|
|
if($this->user['is_customized'] == BTemplate::SOURCE_VISUALIZATION) {//定制项目
|
|
|
|
if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION) {//定制项目
|
|
|
|
$type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
|
|
|
|
//查看当前页面是否定制,是否开启可视化
|
|
|
|
$page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
|
|
...
|
...
|
@@ -336,7 +336,7 @@ class BTemplateLogic extends BaseLogic |
|
|
|
* @time :2023/12/15 10:59
|
|
|
|
*/
|
|
|
|
public function handleVisualizationParam($html,$source, $is_list,$data){
|
|
|
|
if($this->user['is_customized'] == BTemplate::SOURCE_VISUALIZATION){//定制项目
|
|
|
|
if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//定制项目
|
|
|
|
$type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
|
|
|
|
//查看当前页面是否定制,是否开启可视化
|
|
|
|
$page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
|
|
...
|
...
|
@@ -453,13 +453,13 @@ class BTemplateLogic extends BaseLogic |
|
|
|
if ($pageInfo === false) {
|
|
|
|
return $this->success($type);
|
|
|
|
}
|
|
|
|
if ($source == BTemplate::SOURCE_PRODUCT) {if ($is_list == 0) {if ($pageInfo['product_details'] != 0) {$type = BTemplate::TYPE_TWO;}}
|
|
|
|
else {if ($pageInfo['product_list'] != 0) {$type = BTemplate::TYPE_THREE;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_BLOG) {if ($is_list == 0) {if ($pageInfo['blog_details'] != 0) {$type = BTemplate::TYPE_FOUR;}}
|
|
|
|
else {if ($pageInfo['blog_list'] != 0) {$type = BTemplate::TYPE_FIVE;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_NEWS) {if ($is_list == 0) {if ($pageInfo['news_details'] != 0) {$type = BTemplate::TYPE_SIX;}}
|
|
|
|
else {if ($pageInfo['news_list'] != 0) {$type = BTemplate::TYPE_SEVEN;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_KEYWORD) {if ($pageInfo['polymerization'] != 0) {$type = BTemplate::TYPE_EIGHT;}}
|
|
|
|
if ($source == BTemplate::SOURCE_PRODUCT) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['product_details'] != 0) {$type = BTemplate::TYPE_PRODUCT_DETAIL;}}
|
|
|
|
else {if ($pageInfo['product_list'] != 0) {$type = BTemplate::TYPE_PRODUCT_LIST;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_BLOG) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['blog_details'] != 0) {$type = BTemplate::TYPE_BLOG_DETAIL;}}
|
|
|
|
else {if ($pageInfo['blog_list'] != 0) {$type = BTemplate::TYPE_BLOG_LIST;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_NEWS) {if ($is_list != BTemplate::IS_LIST) {if ($pageInfo['news_details'] != 0) {$type = BTemplate::TYPE_NEWS_DETAIL;}}
|
|
|
|
else {if ($pageInfo['news_list'] != 0) {$type = BTemplate::TYPE_NEWS_LIST;}}}
|
|
|
|
if ($source == BTemplate::SOURCE_KEYWORD) {if ($pageInfo['polymerization'] != 0) {$type = BTemplate::TYPE_CUSTOM_PAGE;}}
|
|
|
|
}
|
|
|
|
return $this->success($type);
|
|
|
|
}
|
|
...
|
...
|
@@ -581,7 +581,7 @@ class BTemplateLogic extends BaseLogic |
|
|
|
$param['main_css'] = characterTruncation($param['html'],'/<style id="globalsojs-styles">(.*?)<\/style>/s');
|
|
|
|
$param['footer_css'] = characterTruncation($param['html'],'/<style id="globalsojs-footer">(.*?)<\/style>/s');
|
|
|
|
if(!isset($param['is_custom'])){
|
|
|
|
$param['is_custom'] = BTemplate::SOURCE_NO_CUSTOM;
|
|
|
|
$param['is_custom'] = BTemplate::IS_NO_CUSTOM;
|
|
|
|
}
|
|
|
|
$param['type'] = BTemplate::PAGE_HTML;//不显示整个HTML
|
|
|
|
return $this->success($param);
|
...
|
...
|
|