|
...
|
...
|
@@ -61,9 +61,12 @@ class BlogCategoryLogic extends BaseLogic |
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
$cate_id = $this->model->insertGetId($this->param);
|
|
|
|
if(!isset($this->param['pid'])){
|
|
|
|
$this->param['pid'] = 0;
|
|
|
|
}
|
|
|
|
//判断为子分类时
|
|
|
|
if(isset($this->param['pid']) && !empty($this->param['pid'])) {
|
|
|
|
//查看当前上级分类下是否有其他分类
|
|
|
|
if($this->param['pid'] != 0){
|
|
|
|
//查看当前上级分类下是否有其他子分类
|
|
|
|
$cate_info = $this->model->read(['pid' => $this->param['pid'], 'id' => ['!=', $cate_id]]);
|
|
|
|
if ($cate_info === false) {
|
|
|
|
//查看当前上一级分类下是否有新闻
|
...
|
...
|
|