正在显示
1 个修改的文件
包含
22 行增加
和
7 行删除
| @@ -105,17 +105,15 @@ class BTemplateLogic extends BaseLogic | @@ -105,17 +105,15 @@ class BTemplateLogic extends BaseLogic | ||
| 105 | 'template_id'=>$this->param['template_id'], | 105 | 'template_id'=>$this->param['template_id'], |
| 106 | ] | 106 | ] |
| 107 | ); | 107 | ); |
| 108 | - //字符串截取 | ||
| 109 | - $this->param['head_html'] = characterTruncation($this->param['html'],'/<header\b[^>]*>(.*?)<\/header>/s'); | ||
| 110 | - $this->param['main_html'] = characterTruncation($this->param['html'],'/<main\b[^>]*>(.*?)<\/main>/s'); | ||
| 111 | - $this->param['footer_html'] = characterTruncation($this->param['html'],'/<footer\b[^>]*>(.*?)<\/footer>/s'); | ||
| 112 | - $this->param['head_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/style>/s'); | ||
| 113 | - $this->param['main_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-style">(.*?)<\/style>/s'); | ||
| 114 | - $this->param['footer_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-footer">(.*?)<\/style>/s'); | ||
| 115 | if($info === false){ | 108 | if($info === false){ |
| 109 | + //字符串截取 | ||
| 110 | + $this->StringProcessing(); | ||
| 116 | $this->param['project_id'] = $this->user['project_id']; | 111 | $this->param['project_id'] = $this->user['project_id']; |
| 112 | + var_dump($this->param); | ||
| 113 | + die(); | ||
| 117 | $rs = $this->model->add($this->param); | 114 | $rs = $this->model->add($this->param); |
| 118 | }else{ | 115 | }else{ |
| 116 | + $this->StringProcessing(); | ||
| 119 | $rs = $this->model->edit($this->param,['id'=>$info['id']]); | 117 | $rs = $this->model->edit($this->param,['id'=>$info['id']]); |
| 120 | } | 118 | } |
| 121 | if($rs === false){ | 119 | if($rs === false){ |
| @@ -123,4 +121,21 @@ class BTemplateLogic extends BaseLogic | @@ -123,4 +121,21 @@ class BTemplateLogic extends BaseLogic | ||
| 123 | } | 121 | } |
| 124 | return $this->success(); | 122 | return $this->success(); |
| 125 | } | 123 | } |
| 124 | + | ||
| 125 | + /** | ||
| 126 | + * @remark :字符串处理 | ||
| 127 | + * @name :StringProcessing | ||
| 128 | + * @author :lyh | ||
| 129 | + * @method :post | ||
| 130 | + * @time :2023/6/29 15:35 | ||
| 131 | + */ | ||
| 132 | + public function StringProcessing(){ | ||
| 133 | + //字符串截取 | ||
| 134 | + $this->param['head_html'] = characterTruncation($this->param['html'],'/<header\b[^>]*>(.*?)<\/header>/s'); | ||
| 135 | + $this->param['main_html'] = characterTruncation($this->param['html'],'/<main\b[^>]*>(.*?)<\/main>/s'); | ||
| 136 | + $this->param['footer_html'] = characterTruncation($this->param['html'],'/<footer\b[^>]*>(.*?)<\/footer>/s'); | ||
| 137 | + $this->param['head_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/style>/s'); | ||
| 138 | + $this->param['main_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-style">(.*?)<\/style>/s'); | ||
| 139 | + $this->param['footer_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-footer">(.*?)<\/style>/s'); | ||
| 140 | + } | ||
| 126 | } | 141 | } |
-
请 注册 或 登录 后发表评论