作者 lyh

gx

... ... @@ -77,7 +77,6 @@ class NewsCategoryController extends BaseController
'id.required' => 'ID不能为空'
]);
$info = $newsCategoryLogic->info_news_category();
$info['url'] = $this->user['domain'] . $info['alias'];
$this->response('success',Code::SUCCESS,$info);
}
... ...
... ... @@ -133,7 +133,6 @@ class NewsController extends BaseController
'id.required' => 'ID不能为空',
]);
$info = $newsLogic->newsInfo();
$this->response('success',Code::SUCCESS,$info);
}
... ...
... ... @@ -96,7 +96,7 @@ class BlogCategoryLogic extends BaseLogic
}
//查询当前分类下是否有商品
$blogModel = new BlogModel();
$info = $blogModel->read(['id'=>['like','%,'.$id.',%']],['id']);
$info = $blogModel->read(['category_id'=>['like','%,'.$id.',%']],['id']);
if($info !== false){
$this->fail('当前分类下已存在博客,请先把博客移除当前分类,在修改');
}
... ...
... ... @@ -47,6 +47,7 @@ class NewsCategoryLogic extends BaseLogic
*/
public function info_news_category(){
$info = $this->model->read($this->param);
$info['url'] = $this->user['domain'] . $info['alias'];
return $this->success($info);
}
... ... @@ -125,7 +126,7 @@ class NewsCategoryLogic extends BaseLogic
}
//查询当前分类下是否有商品
$newsModel = new NewsModel();
$info = $newsModel->read(['id'=>['like','%,'.$id.',%']]);
$info = $newsModel->read(['category_id'=>['like','%,'.$id.',%']]);
if($info !== false){
$this->fail('当前分类下已存在新闻,不允许修改上级');
}
... ...