作者 lyh

gx

@@ -80,7 +80,7 @@ class BTemplateLogic extends BaseLogic @@ -80,7 +80,7 @@ class BTemplateLogic extends BaseLogic
80 $mainInfo = $this->getMAinHtml($this->param['source'],$is_custom,$is_list);//获取中间部分代码 80 $mainInfo = $this->getMAinHtml($this->param['source'],$is_custom,$is_list);//获取中间部分代码
81 }else{ 81 }else{
82 if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码 82 if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码
83 - $commonInfo = $this->getCommonHtml($this->param['source'],$is_list,0,0);//获取定制头部 83 + $commonInfo = $this->getCommonHtml($this->param['source'],$is_list,0);//获取定制头部
84 $html = $this->handleAllHtml($commonInfo,$templateInfo['html']); 84 $html = $this->handleAllHtml($commonInfo,$templateInfo['html']);
85 return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]); 85 return $this->success(['html'=>$html,'template_id'=>$template_id,'id'=>$templateInfo['id'],'updated_at'=>$templateInfo['updated_at']]);
86 } 86 }
@@ -172,7 +172,7 @@ class BTemplateLogic extends BaseLogic @@ -172,7 +172,7 @@ class BTemplateLogic extends BaseLogic
172 if($customHtmlInfo === false){ 172 if($customHtmlInfo === false){
173 $this->fail('定制页面,请先上传代码块'); 173 $this->fail('定制页面,请先上传代码块');
174 } 174 }
175 - $commonInfo = $this->getCommonHtml($type,$is_list,0,0);//获取定制头部 175 + $commonInfo = $this->getCommonHtml($type,$is_list,0);//获取定制头部
176 if($commonInfo !== false){ 176 if($commonInfo !== false){
177 $customHtmlInfo['main_html'] = $this->handleAllHtml($commonInfo,$customHtmlInfo['main_html']); 177 $customHtmlInfo['main_html'] = $this->handleAllHtml($commonInfo,$customHtmlInfo['main_html']);
178 } 178 }
@@ -247,7 +247,7 @@ class BTemplateLogic extends BaseLogic @@ -247,7 +247,7 @@ class BTemplateLogic extends BaseLogic
247 * @method :post 247 * @method :post
248 * @time :2023/10/21 16:55 248 * @time :2023/10/21 16:55
249 */ 249 */
250 - public function getCommonHtml($source,$is_list,$template_id,$is_custom){ 250 + public function getCommonHtml($source,$is_list,$template_id,$is_custom = 0){
251 $type = $this->getType($source,$is_list,$template_id,$is_custom); 251 $type = $this->getType($source,$is_list,$template_id,$is_custom);
252 $data = [ 252 $data = [
253 'template_id' => $template_id, 253 'template_id' => $template_id,
@@ -440,7 +440,7 @@ class BTemplateLogic extends BaseLogic @@ -440,7 +440,7 @@ class BTemplateLogic extends BaseLogic
440 * @method :post 440 * @method :post
441 * @time :2023/10/21 17:29 441 * @time :2023/10/21 17:29
442 */ 442 */
443 - public function getType($source,$is_list,$template_id,$is_custom){ 443 + public function getType($source,$is_list,$template_id,$is_custom = 0){
444 $type = BTemplate::SOURCE_HOME;//首页公共头部底部 444 $type = BTemplate::SOURCE_HOME;//首页公共头部底部
445 $is_head = $this->user['configuration']['is_head'] ?? BTemplate::IS_NO_HEADER; 445 $is_head = $this->user['configuration']['is_head'] ?? BTemplate::IS_NO_HEADER;
446 if($is_custom == BTemplate::IS_CUSTOM){//拓展模块为首页头部 446 if($is_custom == BTemplate::IS_CUSTOM){//拓展模块为首页头部
@@ -176,14 +176,14 @@ class InitHtmlLogic extends BaseLogic @@ -176,14 +176,14 @@ class InitHtmlLogic extends BaseLogic
176 * @method :post 176 * @method :post
177 * @time :2023/10/21 17:29 177 * @time :2023/10/21 17:29
178 */ 178 */
179 - public function getType($source,$is_list,$template_id,$is_custom){ 179 + public function getType($source,$is_list,$template_id,$is_custom = 0){
180 $type = BTemplate::SOURCE_HOME;//首页公共头部底部 180 $type = BTemplate::SOURCE_HOME;//首页公共头部底部
181 $is_head = $this->user['configuration']['is_head'] ?? BTemplate::IS_NO_HEADER; 181 $is_head = $this->user['configuration']['is_head'] ?? BTemplate::IS_NO_HEADER;
182 if($template_id == 0){//保存上传的代码块时,默认为独立头部 182 if($template_id == 0){//保存上传的代码块时,默认为独立头部
183 $is_head == BTemplate::IS_HEADER; 183 $is_head == BTemplate::IS_HEADER;
184 } 184 }
185 if($is_custom == BTemplate::IS_CUSTOM){//拓展模块为首页头部 185 if($is_custom == BTemplate::IS_CUSTOM){//拓展模块为首页头部
186 - $is_head == BTemplate::IS_NO_HEADER; 186 + return $this->success($type);
187 } 187 }
188 //查看页面是否设置自定义头部底部 188 //查看页面是否设置自定义头部底部
189 if($is_head != BTemplate::IS_NO_HEADER) { 189 if($is_head != BTemplate::IS_NO_HEADER) {