|
@@ -28,7 +28,7 @@ class InitHtmlLogic extends BaseLogic |
|
@@ -28,7 +28,7 @@ class InitHtmlLogic extends BaseLogic |
|
28
|
* @remark :获取非定制项目复合页数据
|
28
|
* @remark :获取非定制项目复合页数据
|
|
29
|
* @name :getDetailHtml
|
29
|
* @name :getDetailHtml
|
|
30
|
* @author :lyh
|
30
|
* @author :lyh
|
|
31
|
- * @method :post
|
31
|
+ * @method :post $param (type:类型,2产品 3博客 4新闻 对应扩展模块的id)
|
|
32
|
* @time :2023/12/27 10:50
|
32
|
* @time :2023/12/27 10:50
|
|
33
|
*/
|
33
|
*/
|
|
34
|
public function getDetailHtml(){
|
34
|
public function getDetailHtml(){
|
|
@@ -94,17 +94,18 @@ class InitHtmlLogic extends BaseLogic |
|
@@ -94,17 +94,18 @@ class InitHtmlLogic extends BaseLogic |
|
94
|
* @method :post
|
94
|
* @method :post
|
|
95
|
* @time :2023/12/15 18:12
|
95
|
* @time :2023/12/15 18:12
|
|
96
|
*/
|
96
|
*/
|
|
97
|
- public function saveDetailCommonHtml($html,$template_id,$is_custom,$is_list){
|
97
|
+ public function saveDetailCommonHtml($html,$type,$template_id,$is_custom,$is_list){
|
|
98
|
$publicData = $this->handleCommonParam($html);
|
98
|
$publicData = $this->handleCommonParam($html);
|
|
99
|
$templateCommonModel = new BTemplateCommon();
|
99
|
$templateCommonModel = new BTemplateCommon();
|
|
100
|
- if($is_custom == BTemplate::SOURCE_CUSTOM){//扩展模块
|
|
|
|
101
|
- //更新首页头部底部
|
|
|
|
102
|
- $templateCommonModel->edit($publicData,['type'=>BTemplate::SOURCE_HOME,'project_id'=>$this->user['project_id'],'template_id'=>$template_id]);
|
|
|
|
103
|
- return $this->success();
|
|
|
|
104
|
- }
|
|
|
|
105
|
//查看当前模板是否有独立头部,有独立头部,更新独立头部,无独立头部,更新公共头部
|
100
|
//查看当前模板是否有独立头部,有独立头部,更新独立头部,无独立头部,更新公共头部
|
|
106
|
- if(isset($this->user['configuration']['is_head']) && ($this->user['configuration']['is_head'] != 0)) {
|
|
|
|
107
|
- $templateCommonInfo = $templateCommonModel->read(['type'=>$type,'project_id'=>$this->user['project_id'],'template_id'=>$template_id]);
|
101
|
+ $is_head = $this->user['configuration']['is_head'] ?? 0;
|
|
|
|
102
|
+ if($is_custom == BTemplate::SOURCE_CUSTOM){//todo::扩展模块无独立头部底部
|
|
|
|
103
|
+ $is_head = BTemplate::IS_NO_HEADER;
|
|
|
|
104
|
+ }
|
|
|
|
105
|
+ if($is_head == BTemplate::IS_HEADER) {
|
|
|
|
106
|
+ //有独立头部,更新独立头部
|
|
|
|
107
|
+ $commonType = $this->getHeaderType($type,$is_list);
|
|
|
|
108
|
+ $templateCommonInfo = $templateCommonModel->read(['project_id'=>$this->user['project_id'],'template_id'=>$template_id,'type'=>$commonType]);
|
|
108
|
if($templateCommonInfo === false){
|
109
|
if($templateCommonInfo === false){
|
|
109
|
$publicData['type'] = $type;
|
110
|
$publicData['type'] = $type;
|
|
110
|
$publicData['project_id'] = $this->user['project_id'];
|
111
|
$publicData['project_id'] = $this->user['project_id'];
|
|
@@ -114,9 +115,10 @@ class InitHtmlLogic extends BaseLogic |
|
@@ -114,9 +115,10 @@ class InitHtmlLogic extends BaseLogic |
|
114
|
$templateCommonModel->edit($publicData,['id'=>$templateCommonInfo['id']]);
|
115
|
$templateCommonModel->edit($publicData,['id'=>$templateCommonInfo['id']]);
|
|
115
|
}
|
116
|
}
|
|
116
|
}else{
|
117
|
}else{
|
|
117
|
-
|
118
|
+ //更新首页头部底部
|
|
|
|
119
|
+ $templateCommonModel->edit($publicData,['type'=>BTemplate::SOURCE_HOME,'project_id'=>$this->user['project_id'],'template_id'=>$template_id]);
|
|
118
|
}
|
120
|
}
|
|
119
|
- return true;
|
121
|
+ return $this->success();
|
|
120
|
}
|
122
|
}
|
|
121
|
|
123
|
|
|
122
|
/**
|
124
|
/**
|
|
@@ -161,20 +163,20 @@ class InitHtmlLogic extends BaseLogic |
|
@@ -161,20 +163,20 @@ class InitHtmlLogic extends BaseLogic |
|
161
|
* @time :2023/12/15 18:06
|
163
|
* @time :2023/12/15 18:06
|
|
162
|
*/
|
164
|
*/
|
|
163
|
public function getTypeCommonHtml($template_id,$type,$is_custom,$is_list){
|
165
|
public function getTypeCommonHtml($template_id,$type,$is_custom,$is_list){
|
|
|
|
166
|
+ //判断当前项目是否有设置独立头部的权限
|
|
|
|
167
|
+ $is_head = $this->user['configuration']['is_head'] ?? 0;
|
|
|
|
168
|
+ if($is_custom == BTemplate::SOURCE_CUSTOM){//todo::拓展模块默认取首页
|
|
|
|
169
|
+ $is_head = BTemplate::IS_NO_HEADER;
|
|
|
|
170
|
+ }
|
|
164
|
//获取首页公共部分
|
171
|
//获取首页公共部分
|
|
165
|
$templateCommonModel = new BTemplateCommon();
|
172
|
$templateCommonModel = new BTemplateCommon();
|
|
166
|
- $commonInfo = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>1]);
|
|
|
|
167
|
- if($is_custom == BTemplate::SOURCE_CUSTOM){
|
|
|
|
168
|
- return $this->success($commonInfo);
|
|
|
|
169
|
- }
|
|
|
|
170
|
- //判断当前项目是否有设置独立头部的权限
|
|
|
|
171
|
- if(isset($this->user['configuration']['is_head']) && ($this->user['configuration']['is_head'] != 0)) {
|
173
|
+ if($is_head == BTemplate::IS_HEADER) {
|
|
172
|
//有独立头部,获取独立头部
|
174
|
//有独立头部,获取独立头部
|
|
173
|
$commonType = $this->getHeaderType($type,$is_list);
|
175
|
$commonType = $this->getHeaderType($type,$is_list);
|
|
174
|
- $commonTypeInfo = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$commonType['type']]);
|
|
|
|
175
|
- if($commonTypeInfo !== false){
|
|
|
|
176
|
- $commonInfo = $commonTypeInfo;
|
|
|
|
177
|
- }
|
176
|
+ $commonInfo = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$commonType]);
|
|
|
|
177
|
+ }else{
|
|
|
|
178
|
+ //首页头底
|
|
|
|
179
|
+ $commonInfo = $templateCommonModel->read(['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>BTemplate::SOURCE_HOME]);
|
|
178
|
}
|
180
|
}
|
|
179
|
return $this->success($commonInfo);
|
181
|
return $this->success($commonInfo);
|
|
180
|
}
|
182
|
}
|
|
@@ -209,7 +211,7 @@ class InitHtmlLogic extends BaseLogic |
|
@@ -209,7 +211,7 @@ class InitHtmlLogic extends BaseLogic |
|
209
|
$resultType = BTemplate::TYPE_SIX;
|
211
|
$resultType = BTemplate::TYPE_SIX;
|
|
210
|
}
|
212
|
}
|
|
211
|
}
|
213
|
}
|
|
212
|
- return $this->success(['type'=>$resultType]);
|
214
|
+ return $this->success($resultType);
|
|
213
|
}
|
215
|
}
|
|
214
|
|
216
|
|
|
215
|
/**
|
217
|
/**
|