|
@@ -174,8 +174,8 @@ class BTemplateLogic extends BaseLogic |
|
@@ -174,8 +174,8 @@ class BTemplateLogic extends BaseLogic |
|
174
|
*/
|
174
|
*/
|
|
175
|
public function templateSave(){
|
175
|
public function templateSave(){
|
|
176
|
//查询当前模版是否已保存
|
176
|
//查询当前模版是否已保存
|
|
177
|
-// DB::beginTransaction();
|
|
|
|
178
|
-// try {
|
177
|
+ DB::beginTransaction();
|
|
|
|
178
|
+ try {
|
|
179
|
$info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']);
|
179
|
$info = $this->webTemplateInfo($this->param['template_id'],$this->param['source'],$this->param['source_id']);
|
|
180
|
//字符串截取
|
180
|
//字符串截取
|
|
181
|
$this->param = $this->stringProcessing($this->param);
|
181
|
$this->param = $this->stringProcessing($this->param);
|
|
@@ -186,11 +186,11 @@ class BTemplateLogic extends BaseLogic |
|
@@ -186,11 +186,11 @@ class BTemplateLogic extends BaseLogic |
|
186
|
$this->model->edit($this->param,['id'=>$info['id']]);
|
186
|
$this->model->edit($this->param,['id'=>$info['id']]);
|
|
187
|
}
|
187
|
}
|
|
188
|
$this->setTemplateLog($this->param);
|
188
|
$this->setTemplateLog($this->param);
|
|
189
|
-// DB::commit();
|
|
|
|
190
|
-// }catch (\Exception $e){
|
|
|
|
191
|
-// DB::rollBack();
|
|
|
|
192
|
-// $this->fail('error');
|
|
|
|
193
|
-// }
|
189
|
+ DB::commit();
|
|
|
|
190
|
+ }catch (\Exception $e){
|
|
|
|
191
|
+ DB::rollBack();
|
|
|
|
192
|
+ $this->fail('error');
|
|
|
|
193
|
+ }
|
|
194
|
//通知更新
|
194
|
//通知更新
|
|
195
|
$this->homeOrProduct($this->param['source'],$this->param['source_id']);
|
195
|
$this->homeOrProduct($this->param['source'],$this->param['source_id']);
|
|
196
|
return $this->success();
|
196
|
return $this->success();
|
|
@@ -209,6 +209,14 @@ class BTemplateLogic extends BaseLogic |
|
@@ -209,6 +209,14 @@ class BTemplateLogic extends BaseLogic |
|
209
|
'project_id'=>$this->user['project_id'],
|
209
|
'project_id'=>$this->user['project_id'],
|
|
210
|
'operator_id'=>$this->user['id'],
|
210
|
'operator_id'=>$this->user['id'],
|
|
211
|
'text'=>$param['html'],
|
211
|
'text'=>$param['html'],
|
|
|
|
212
|
+ 'source'=>$param['source'],
|
|
|
|
213
|
+ 'source_id'=>$param['source_id'],
|
|
|
|
214
|
+ 'head_html'=>$param['head_html'],
|
|
|
|
215
|
+ 'head_css'=>$param['head_css'],
|
|
|
|
216
|
+ 'main_html'=>$param['main_html'],
|
|
|
|
217
|
+ 'main_css'=>$param['main_css'],
|
|
|
|
218
|
+ 'footer_html'=>$param['footer_html'],
|
|
|
|
219
|
+ 'footer_css'=>$param['footer_css'],
|
|
212
|
];
|
220
|
];
|
|
213
|
$bTemplateLogModel = new BTemplateLog();
|
221
|
$bTemplateLogModel = new BTemplateLog();
|
|
214
|
return $bTemplateLogModel->add($data);
|
222
|
return $bTemplateLogModel->add($data);
|