|
...
|
...
|
@@ -89,7 +89,7 @@ class BTemplateLogic extends BaseLogic |
|
|
|
$type = $this->getCustomizedType($source, $source_id);//定制获取头部底部类型
|
|
|
|
$commonInfo = $this->getCommonPage($type,$this->user['project_id'],0);//获取定制头部
|
|
|
|
$html = $this->handleAllHtml($commonInfo,$templateInfo['html']);
|
|
|
|
return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id']]);
|
|
|
|
return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]);
|
|
|
|
}
|
|
|
|
$mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']];
|
|
|
|
}
|
|
...
|
...
|
@@ -98,7 +98,10 @@ class BTemplateLogic extends BaseLogic |
|
|
|
$commonInfo['head_html'].$mainInfo['main_html'].$commonInfo['footer_html'];
|
|
|
|
$html = $this->getHeadFooter($html);
|
|
|
|
$result = ['html'=>$html,'template_id'=>$template_id];
|
|
|
|
if($templateInfo !== false){$result['id'] = $templateInfo['id'];}
|
|
|
|
if($templateInfo !== false){
|
|
|
|
$result['id'] = $templateInfo['id'];
|
|
|
|
$result['updated_at'] = $templateInfo['updated_at'];
|
|
|
|
}
|
|
|
|
return $this->success($result);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -618,7 +621,10 @@ class BTemplateLogic extends BaseLogic |
|
|
|
* @method :post
|
|
|
|
* @time :2023/7/27 15:08
|
|
|
|
*/
|
|
|
|
public function getModule($type){
|
|
|
|
public function getModule($type,$is_custom){
|
|
|
|
if($is_custom == BTemplate::SOURCE_CUSTOM){
|
|
|
|
$type == BTemplate::TYPE_CUSTOM_DETAIL;
|
|
|
|
}
|
|
|
|
$mainModel = new TemplateTypeMain();
|
|
|
|
$info = $mainModel->read(['type'=>$type]);
|
|
|
|
return $info['main_html'];
|
|
...
|
...
|
@@ -709,7 +715,7 @@ class BTemplateLogic extends BaseLogic |
|
|
|
$moduleModel = new CustomModule();
|
|
|
|
$moduleList = $moduleModel->list(['status'=>0]);
|
|
|
|
foreach ($moduleList as $v){
|
|
|
|
$moduleCategory = $this->getCategoryList((new CustomModuleCategory()),0,['id','name','pid']);
|
|
|
|
$moduleCategory = $this->getCategoryModuleList((new CustomModuleCategory()),$v['id'],0,['id','name','pid']);
|
|
|
|
$categoryList = [["id"=>"all", "name"=>"全部"], ["id"=>"new", "name"=>"最新"]];
|
|
|
|
foreach ($moduleCategory as $values){
|
|
|
|
$categoryList[] = $values;
|
|
...
|
...
|
@@ -782,6 +788,26 @@ class BTemplateLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取1级+2级
|
|
|
|
* @name :getCategoryList
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/12/20 10:26
|
|
|
|
*/
|
|
|
|
public function getCategoryModuleList($categoryModel,$module_id,$status = 0,$filed = ['*']){
|
|
|
|
$data = array();
|
|
|
|
$list = $categoryModel->list(['pid'=>0, 'module_id'=>$module_id , 'status'=>$status],['sort','id'],$filed);
|
|
|
|
foreach ($list as $v){
|
|
|
|
$data[] = $v;
|
|
|
|
$son_list = $categoryModel->list(['pid'=>$v['id'],'module_id'=>$module_id,'status'=>$status],['sort','id'],$filed);
|
|
|
|
foreach ($son_list as $v1){
|
|
|
|
$data[] = $v1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存html
|
|
|
|
* @name :savePublicTemplateHtml
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -819,9 +845,9 @@ class BTemplateLogic extends BaseLogic |
|
|
|
$commonInfo = $this->getTypeCommonHtml($bSettingInfo['template_id'],$this->param['type'],$is_custom);
|
|
|
|
//获取设置的默认中间部分
|
|
|
|
$bTemplateMainModel = new BTemplateMain();
|
|
|
|
$mainInfo = $bTemplateMainModel->read(['project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
|
|
|
|
$mainInfo = $bTemplateMainModel->read(['project_id'=>$this->user['project_id'],'type'=>$this->param['type'],'is_custom'=>$is_custom]);
|
|
|
|
if($mainInfo === false){
|
|
|
|
$main_html = $this->getModule($this->param['type']);
|
|
|
|
$main_html = $this->getModule($this->param['type'],$is_custom);
|
|
|
|
$main_style = "<style id='globalsojs-styles'></style>";
|
|
|
|
}else{
|
|
|
|
$main_html = $mainInfo['main_html'];
|
...
|
...
|
|