作者 lyh

gx

... ... @@ -28,8 +28,8 @@ class BlogCategoryLogic extends BaseLogic
public function categorySave(){
//验证名称是否存在
$this->verifyParamName($this->param['name']);
DB::beginTransaction();
try {
// DB::beginTransaction();
// try {
if(isset($this->param['id']) && !empty($this->param['id'])){
//查看路由是否更新
$id = $this->editCategoryRoute($this->param['id'], $this->param['alias']);
... ... @@ -46,11 +46,11 @@ class BlogCategoryLogic extends BaseLogic
$route = RouteMap::setRoute(isset($this->param['alias']) ? $this->param['alias'] : $this->param['name'],
RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']);
$this->edit(['alias'=>$route],['id'=>$id]);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('系统错误,请联系管理');
}
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('系统错误,请联系管理');
// }
//通知更新
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_BLOG_CATE, 'route'=>$route]);
return $this->success();
... ...