|
@@ -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();
|