|
...
|
...
|
@@ -105,7 +105,15 @@ class BlogCategoryLogic extends BaseLogic |
|
|
|
if($info !== false){
|
|
|
|
$this->fail('当前分类名称已存在');
|
|
|
|
}
|
|
|
|
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
if($info['pid'] != $this->param['pid']){
|
|
|
|
//查询当前分类下是否有商品
|
|
|
|
$blogModel = new BlogModel();
|
|
|
|
$info = $blogModel->read(['id'=>['like','%,'.$this->param['id'].',%']]);
|
|
|
|
if($info !== false){
|
|
|
|
$this->fail('当前分类下已存在博客,不允许修改上级');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$this->param['operator_id'] = $this->user['id'];
|
|
|
|
$this->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_BLOG_CATE, $this->param['id'], $this->user['project_id']);
|
...
|
...
|
|