作者 lyh

gx

@@ -127,7 +127,7 @@ class CustomModuleLogic extends BaseLogic @@ -127,7 +127,7 @@ class CustomModuleLogic extends BaseLogic
127 if($categoryInfo !== false){ 127 if($categoryInfo !== false){
128 $this->fail('当前模块拥有分类不允许删除'); 128 $this->fail('当前模块拥有分类不允许删除');
129 } 129 }
130 - $rs = $this->model->del($this->param); 130 + $rs = (new CustomModule())->del($this->param);
131 if($rs === false){ 131 if($rs === false){
132 $this->fail('系统错误,请联系管理员'); 132 $this->fail('系统错误,请联系管理员');
133 } 133 }
@@ -333,11 +333,17 @@ class BTemplateLogic extends BaseLogic @@ -333,11 +333,17 @@ class BTemplateLogic extends BaseLogic
333 * @method :post 333 * @method :post
334 * @time :2023/12/13 17:02 334 * @time :2023/12/13 17:02
335 */ 335 */
336 - public function saveHtml($html,$source,$source_id,$template_id = 0,$is_custom = 0){ 336 + public function saveHtml($html,$source,$source_id,$section_list_id,$template_id = 0,$is_custom = 0){
337 $this->saveCommonHtml($html,$source,$source_id,$template_id);//保存头部底部 337 $this->saveCommonHtml($html,$source,$source_id,$template_id);//保存头部底部
338 $info = $this->webTemplateInfo($this->param['template_id'],$source,$source_id,$is_custom); 338 $info = $this->webTemplateInfo($this->param['template_id'],$source,$source_id,$is_custom);
  339 + $handleInfo = $this->handleTemplateParam($html);
339 if($info === false){ 340 if($info === false){
340 - $data = []; 341 + //TODO::查看当前界面是否为定制界面
  342 + $data = [
  343 + 'source'=>$source,'source_id'=>$source_id,'section_list_id'=>$section_list_id,
  344 + 'template_id'=>$template_id, 'project_id'=>$this->user['project_id'],
  345 + 'main_html'=>$handleInfo['main_html'],'main_css'=>$handleInfo['main_css']
  346 + ];
341 $this->model->add($data); 347 $this->model->add($data);
342 }else{ 348 }else{
343 $data = []; 349 $data = [];
@@ -448,7 +454,7 @@ class BTemplateLogic extends BaseLogic @@ -448,7 +454,7 @@ class BTemplateLogic extends BaseLogic
448 454
449 /** 455 /**
450 * @remark :保存时字符串处理 456 * @remark :保存时字符串处理
451 - * @name :handleSaveParam 457 + * @name :handleCommonParam
452 * @author :lyh 458 * @author :lyh
453 * @method :post 459 * @method :post
454 * @time :2023/6/29 15:35 460 * @time :2023/6/29 15:35
@@ -465,6 +471,19 @@ class BTemplateLogic extends BaseLogic @@ -465,6 +471,19 @@ class BTemplateLogic extends BaseLogic
465 } 471 }
466 472
467 /** 473 /**
  474 + * @remark :保存时字符串处理
  475 + * @name :handleSaveParam
  476 + * @author :lyh
  477 + * @method :post
  478 + * @time :2023/6/29 15:35
  479 + */
  480 + public function handleTemplateParam($html){
  481 + //字符串截取
  482 + $param['main_html'] = characterTruncation($html,'/<main\b[^>]*>(.*?)<\/main>/s');
  483 + $param['main_css'] = characterTruncation($html,'/<style id="globalsojs-styles">(.*?)<\/style>/s');
  484 + return $this->success($param);
  485 + }
  486 + /**
468 * @remark :获取设置的类型 487 * @remark :获取设置的类型
469 * @name :getType 488 * @name :getType
470 * @author :lyh 489 * @author :lyh