|
...
|
...
|
@@ -60,18 +60,18 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
$this->verifyParamName($this->param['name']);
|
|
|
|
//参数处理
|
|
|
|
$this->param = $this->addParamProcessing($this->param);
|
|
|
|
// DB::beginTransaction();
|
|
|
|
// try {
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
$cate_id = $this->model->insertGetId($this->param);
|
|
|
|
//当父级分类拥有产品时,处理产品
|
|
|
|
$this->addProcessingSon($cate_id);
|
|
|
|
RouteMap::setRoute($this->param['alias'] ?: $this->param['name'],
|
|
|
|
RouteMap::SOURCE_NEWS_CATE, $cate_id, $this->user['project_id']);
|
|
|
|
// DB::commit();
|
|
|
|
// }catch (\Exception $e){
|
|
|
|
// DB::rollBack();
|
|
|
|
// $this->fail('error');
|
|
|
|
// }
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::rollBack();
|
|
|
|
$this->fail('error');
|
|
|
|
}
|
|
|
|
//通知更新
|
|
|
|
$this->updateNotify(['project_id'=>$this->user['project_id'],
|
|
|
|
'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$this->param['alias']]);
|
...
|
...
|
|