|
@@ -85,7 +85,7 @@ class BTemplateLogic extends BaseLogic |
|
@@ -85,7 +85,7 @@ class BTemplateLogic extends BaseLogic |
|
85
|
$mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']];
|
85
|
$mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']];
|
|
86
|
}
|
86
|
}
|
|
87
|
$commonInfo = $this->getTemplateComHtml($this->param['source'],$is_list,$is_custom,$template_id);//获取非定制头部
|
87
|
$commonInfo = $this->getTemplateComHtml($this->param['source'],$is_list,$is_custom,$template_id);//获取非定制头部
|
|
88
|
- $html = $commonInfo['head_css'].$mainInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. $commonInfo['head_html'].$mainInfo['main_html'].$commonInfo['footer_html'];
|
88
|
+ $html = $commonInfo['head_style'].$mainInfo['main_style'].$commonInfo['footer_style'].$commonInfo['other']. $commonInfo['head_html'].$mainInfo['main_html'].$commonInfo['footer_html'];
|
|
89
|
$html = $this->getHeadFooter($html);
|
89
|
$html = $this->getHeadFooter($html);
|
|
90
|
$result = ['html'=>$html,'template_id'=>$template_id];
|
90
|
$result = ['html'=>$html,'template_id'=>$template_id];
|
|
91
|
if($templateInfo !== false) {
|
91
|
if($templateInfo !== false) {
|
|
@@ -96,6 +96,75 @@ class BTemplateLogic extends BaseLogic |
|
@@ -96,6 +96,75 @@ class BTemplateLogic extends BaseLogic |
|
96
|
}
|
96
|
}
|
|
97
|
|
97
|
|
|
98
|
/**
|
98
|
/**
|
|
|
|
99
|
+ * @remark :非定制获取头部+底部
|
|
|
|
100
|
+ * @name :getTemplateComHtml
|
|
|
|
101
|
+ * @author :lyh
|
|
|
|
102
|
+ * @method :post
|
|
|
|
103
|
+ * @time :2024/4/29 16:53
|
|
|
|
104
|
+ */
|
|
|
|
105
|
+ public function getTemplateComHtml($source,$is_list,$is_custom,$template_id){
|
|
|
|
106
|
+ $condition = ['common_type'=>BTemplate::COMMON_HEAD,'source'=>'','is_list'=>$is_list,'is_custom'=>$is_custom,'template_id'=>$template_id];
|
|
|
|
107
|
+ $headComInfo = $this->getHeadComHtml($condition,$source,$is_list,$is_custom);
|
|
|
|
108
|
+ $bTemplateComModel = new BTemplateCom();
|
|
|
|
109
|
+ $condition['common_type'] = BTemplate::COMMON_OTHER;
|
|
|
|
110
|
+ $condition['source'] = $headComInfo['source'];
|
|
|
|
111
|
+ $otherInfo = $bTemplateComModel->read($condition);
|
|
|
|
112
|
+ if($otherInfo === false){
|
|
|
|
113
|
+ $this->fail('获取失败,请联系管理员');
|
|
|
|
114
|
+ }
|
|
|
|
115
|
+ $footerComInfo = $this->getFooterComHtml($condition,$source,$is_list,$is_custom);
|
|
|
|
116
|
+ $data = ['head_html'=>$headComInfo['html'] ?? '', 'head_style'=>$headComInfo['html_style'] ?? '', 'other'=>$otherInfo['html'] ?? '',
|
|
|
|
117
|
+ 'footer_html'=>$footerComInfo['html'] ?? '','footer_style'=>$footerComInfo['html_style'] ?? ''];
|
|
|
|
118
|
+ return $this->success($data);
|
|
|
|
119
|
+ }
|
|
|
|
120
|
+
|
|
|
|
121
|
+ /**
|
|
|
|
122
|
+ * @remark :公共头部
|
|
|
|
123
|
+ * @name :HeadComHtml
|
|
|
|
124
|
+ * @author :lyh
|
|
|
|
125
|
+ * @method :post
|
|
|
|
126
|
+ * @time :2024/4/29 17:20
|
|
|
|
127
|
+ */
|
|
|
|
128
|
+ public function getHeadComHtml($condition,$source,$is_list,$is_custom){
|
|
|
|
129
|
+ $commonHead = $this->getType($source,$is_list,$is_custom,BTemplate::COMMON_HEAD);
|
|
|
|
130
|
+ $bTemplateComModel = new BTemplateCom();
|
|
|
|
131
|
+ $condition['source'] = $commonHead;
|
|
|
|
132
|
+ $condition['common_type'] = BTemplate::COMMON_FOOTER;
|
|
|
|
133
|
+ $headComInfo = $bTemplateComModel->read($condition);
|
|
|
|
134
|
+ if($headComInfo === false){
|
|
|
|
135
|
+ //取默认首页的
|
|
|
|
136
|
+ $condition['source'] = BTemplate::SOURCE_HOME;
|
|
|
|
137
|
+ $headComInfo = $bTemplateComModel->read($condition);
|
|
|
|
138
|
+ if($headComInfo === false){
|
|
|
|
139
|
+ $this->fail('获取失败,请联系管理员');
|
|
|
|
140
|
+ }
|
|
|
|
141
|
+ }
|
|
|
|
142
|
+ return $this->success($headComInfo);
|
|
|
|
143
|
+ }
|
|
|
|
144
|
+ /**
|
|
|
|
145
|
+ * @remark :公共底部
|
|
|
|
146
|
+ * @name :footerComHtml
|
|
|
|
147
|
+ * @author :lyh
|
|
|
|
148
|
+ * @method :post
|
|
|
|
149
|
+ * @time :2024/4/29 17:18
|
|
|
|
150
|
+ */
|
|
|
|
151
|
+ public function getFooterComHtml($condition,$source,$is_list,$is_custom){
|
|
|
|
152
|
+ $bTemplateComModel = new BTemplateCom();
|
|
|
|
153
|
+ $condition['common_type'] = BTemplate::COMMON_FOOTER;
|
|
|
|
154
|
+ $condition['source'] = $this->getType($source,$is_list,$is_custom,BTemplate::COMMON_FOOTER);
|
|
|
|
155
|
+ $footerComInfo = $bTemplateComModel->read($condition);
|
|
|
|
156
|
+ if($footerComInfo === false){
|
|
|
|
157
|
+ //取默认首页的
|
|
|
|
158
|
+ $condition['source'] = BTemplate::SOURCE_HOME;
|
|
|
|
159
|
+ $footerComInfo = $bTemplateComModel->read($condition);
|
|
|
|
160
|
+ if($footerComInfo === false){
|
|
|
|
161
|
+ $this->fail('获取失败,请联系管理员');
|
|
|
|
162
|
+ }
|
|
|
|
163
|
+ }
|
|
|
|
164
|
+ return $this->success($footerComInfo);
|
|
|
|
165
|
+ }
|
|
|
|
166
|
+
|
|
|
|
167
|
+ /**
|
|
99
|
* @remark :获取整个html代码
|
168
|
* @remark :获取整个html代码
|
|
100
|
* @name :getCustomizeAllHtml
|
169
|
* @name :getCustomizeAllHtml
|
|
101
|
* @author :lyh
|
170
|
* @author :lyh
|
|
@@ -104,11 +173,11 @@ class BTemplateLogic extends BaseLogic |
|
@@ -104,11 +173,11 @@ class BTemplateLogic extends BaseLogic |
|
104
|
*/
|
173
|
*/
|
|
105
|
public function getCustomizeAllHtml($templateInfo,$template_id,$is_custom,$is_list){
|
174
|
public function getCustomizeAllHtml($templateInfo,$template_id,$is_custom,$is_list){
|
|
106
|
if($is_custom == BTemplate::IS_CUSTOM){
|
175
|
if($is_custom == BTemplate::IS_CUSTOM){
|
|
107
|
- $commonInfo = $this->getTemplateComHtml($templateInfo['source'],$is_custom,$is_list);//获取定制头部
|
176
|
+ $commonInfo = $this->getCustomizeTemplateComHtml($templateInfo['source'],$is_custom,$is_list);//获取定制头部
|
|
108
|
$html = $this->handleAllHtml($commonInfo,$templateInfo['html']);
|
177
|
$html = $this->handleAllHtml($commonInfo,$templateInfo['html']);
|
|
109
|
}else{
|
178
|
}else{
|
|
110
|
$type = $this->getCustomizedType($templateInfo['source'],$is_list);
|
179
|
$type = $this->getCustomizedType($templateInfo['source'],$is_list);
|
|
111
|
- $commonInfo = $this->getTemplateComHtml($type,$is_custom,$is_list);//获取定制头部
|
180
|
+ $commonInfo = $this->getCustomizeTemplateComHtml($type,$is_custom,$is_list);//获取定制头部
|
|
112
|
$html = $this->handleAllHtml($commonInfo,$templateInfo['html']);
|
181
|
$html = $this->handleAllHtml($commonInfo,$templateInfo['html']);
|
|
113
|
}
|
182
|
}
|
|
114
|
return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]);
|
183
|
return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]);
|
|
@@ -178,7 +247,7 @@ class BTemplateLogic extends BaseLogic |
|
@@ -178,7 +247,7 @@ class BTemplateLogic extends BaseLogic |
|
178
|
if($customHtmlInfo === false){
|
247
|
if($customHtmlInfo === false){
|
|
179
|
$this->fail('定制页面,请先上传代码块');
|
248
|
$this->fail('定制页面,请先上传代码块');
|
|
180
|
}
|
249
|
}
|
|
181
|
- $commonInfo = $this->getTemplateComHtml($source,$is_custom,$is_list);//获取定制头部
|
250
|
+ $commonInfo = $this->getCustomizeTemplateComHtml($source,$is_custom,$is_list);//获取定制头部
|
|
182
|
if($commonInfo !== false){
|
251
|
if($commonInfo !== false){
|
|
183
|
$customHtmlInfo['main_html'] = $this->handleAllHtml($commonInfo,$customHtmlInfo['main_html']);
|
252
|
$customHtmlInfo['main_html'] = $this->handleAllHtml($commonInfo,$customHtmlInfo['main_html']);
|
|
184
|
}
|
253
|
}
|
|
@@ -258,7 +327,7 @@ class BTemplateLogic extends BaseLogic |
|
@@ -258,7 +327,7 @@ class BTemplateLogic extends BaseLogic |
|
258
|
if($customHtmlInfo === false){
|
327
|
if($customHtmlInfo === false){
|
|
259
|
$this->fail('定制页面,请先上传代码块');
|
328
|
$this->fail('定制页面,请先上传代码块');
|
|
260
|
}
|
329
|
}
|
|
261
|
- $commonInfo = $this->getTemplateComHtml($type,$is_custom,$is_list);//获取定制头部
|
330
|
+ $commonInfo = $this->getCustomizeTemplateComHtml($type,$is_custom,$is_list);//获取定制头部
|
|
262
|
if($commonInfo !== false){
|
331
|
if($commonInfo !== false){
|
|
263
|
$customHtmlInfo['main_html'] = $this->handleAllHtml($commonInfo,$customHtmlInfo['main_html']);
|
332
|
$customHtmlInfo['main_html'] = $this->handleAllHtml($commonInfo,$customHtmlInfo['main_html']);
|
|
264
|
}
|
333
|
}
|
|
@@ -275,7 +344,7 @@ class BTemplateLogic extends BaseLogic |
|
@@ -275,7 +344,7 @@ class BTemplateLogic extends BaseLogic |
|
275
|
* @method :post
|
344
|
* @method :post
|
|
276
|
* @time :2023/12/29 13:13
|
345
|
* @time :2023/12/29 13:13
|
|
277
|
*/
|
346
|
*/
|
|
278
|
- public function getTemplateComHtml($type,$is_custom,$is_list,$template_id = 0){
|
347
|
+ public function getCustomizeTemplateComHtml($type,$is_custom,$is_list,$template_id = 0){
|
|
279
|
$data = ['head_html'=>'','head_style'=>'','footer_html'=>'','footer_style'=>'','other'=>''];
|
348
|
$data = ['head_html'=>'','head_style'=>'','footer_html'=>'','footer_style'=>'','other'=>''];
|
|
280
|
$param = ['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$type,'is_custom'=>$is_custom,'is_list'=>$is_list];
|
349
|
$param = ['template_id'=>$template_id,'project_id'=>$this->user['project_id'],'type'=>$type,'is_custom'=>$is_custom,'is_list'=>$is_list];
|
|
281
|
$commonTemplateModel = new BTemplateCom();
|
350
|
$commonTemplateModel = new BTemplateCom();
|