正在显示
1 个修改的文件
包含
8 行增加
和
8 行删除
| @@ -193,8 +193,8 @@ class BTemplateLogic extends BaseLogic | @@ -193,8 +193,8 @@ class BTemplateLogic extends BaseLogic | ||
| 193 | $this->fail('演示项目仅支持演示功能,无法更改首页'); | 193 | $this->fail('演示项目仅支持演示功能,无法更改首页'); |
| 194 | } | 194 | } |
| 195 | //查询当前模版是否已保存 | 195 | //查询当前模版是否已保存 |
| 196 | -// DB::beginTransaction(); | ||
| 197 | -// try { | 196 | + DB::beginTransaction(); |
| 197 | + try { | ||
| 198 | $info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']); | 198 | $info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']); |
| 199 | //字符串截取 | 199 | //字符串截取 |
| 200 | $this->param = $this->stringProcessing($this->param); | 200 | $this->param = $this->stringProcessing($this->param); |
| @@ -206,11 +206,11 @@ class BTemplateLogic extends BaseLogic | @@ -206,11 +206,11 @@ class BTemplateLogic extends BaseLogic | ||
| 206 | } | 206 | } |
| 207 | $this->saveCommonTemplate($this->param); | 207 | $this->saveCommonTemplate($this->param); |
| 208 | $this->setTemplateLog($this->param); | 208 | $this->setTemplateLog($this->param); |
| 209 | -// DB::commit(); | ||
| 210 | -// }catch (\Exception $e){ | ||
| 211 | -// DB::rollBack(); | ||
| 212 | -// $this->fail('error'); | ||
| 213 | -// } | 209 | + DB::commit(); |
| 210 | + }catch (\Exception $e){ | ||
| 211 | + DB::rollBack(); | ||
| 212 | + $this->fail('系统错误,请联系管理员'); | ||
| 213 | + } | ||
| 214 | //通知更新 | 214 | //通知更新 |
| 215 | $this->homeOrProduct($this->param['source'],$this->param['source_id']); | 215 | $this->homeOrProduct($this->param['source'],$this->param['source_id']); |
| 216 | return $this->success(); | 216 | return $this->success(); |
| @@ -231,7 +231,7 @@ class BTemplateLogic extends BaseLogic | @@ -231,7 +231,7 @@ class BTemplateLogic extends BaseLogic | ||
| 231 | 'head_css'=>$param['head_css'], | 231 | 'head_css'=>$param['head_css'], |
| 232 | 'footer_html'=>$param['footer_html'], | 232 | 'footer_html'=>$param['footer_html'], |
| 233 | 'footer_css'=>$param['footer_css'], | 233 | 'footer_css'=>$param['footer_css'], |
| 234 | - 'other'=>str_replace('header','',characterTruncation($param['html'],'/<link id="google-fonts-link">(.*?)header/s')), | 234 | + 'other'=>str_replace('<header','',characterTruncation($param['html'],'/<link id="google-fonts-link"\b[^>]*>(.*?)header/s')), |
| 235 | ]; | 235 | ]; |
| 236 | if($info === false){ | 236 | if($info === false){ |
| 237 | $data['template_id'] = $param['template_id']; | 237 | $data['template_id'] = $param['template_id']; |
-
请 注册 或 登录 后发表评论