|
@@ -15,7 +15,6 @@ class NewsCategoryLogic extends BaseLogic |
|
@@ -15,7 +15,6 @@ class NewsCategoryLogic extends BaseLogic |
|
15
|
public function __construct()
|
15
|
public function __construct()
|
|
16
|
{
|
16
|
{
|
|
17
|
parent::__construct();
|
17
|
parent::__construct();
|
|
18
|
-
|
|
|
|
19
|
$this->model = new NewsCategoryModel();
|
18
|
$this->model = new NewsCategoryModel();
|
|
20
|
$this->param = $this->requestAll;
|
19
|
$this->param = $this->requestAll;
|
|
21
|
}
|
20
|
}
|
|
@@ -117,6 +116,9 @@ class NewsCategoryLogic extends BaseLogic |
|
@@ -117,6 +116,9 @@ class NewsCategoryLogic extends BaseLogic |
|
117
|
$this->fail('当前分类名称已存在');
|
116
|
$this->fail('当前分类名称已存在');
|
|
118
|
}
|
117
|
}
|
|
119
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
118
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
119
|
+ if($info['id'] == $this->param['pid']){
|
|
|
|
120
|
+ $this->fail('不能成为自己的上级');
|
|
|
|
121
|
+ }
|
|
120
|
if($info['pid'] != $this->param['pid']){
|
122
|
if($info['pid'] != $this->param['pid']){
|
|
121
|
//查询当前分类下是否有商品
|
123
|
//查询当前分类下是否有商品
|
|
122
|
$newsModel = new NewsModel();
|
124
|
$newsModel = new NewsModel();
|