正在显示
4 个修改的文件
包含
3 行增加
和
4 行删除
| @@ -77,7 +77,6 @@ class NewsCategoryController extends BaseController | @@ -77,7 +77,6 @@ class NewsCategoryController extends BaseController | ||
| 77 | 'id.required' => 'ID不能为空' | 77 | 'id.required' => 'ID不能为空' |
| 78 | ]); | 78 | ]); |
| 79 | $info = $newsCategoryLogic->info_news_category(); | 79 | $info = $newsCategoryLogic->info_news_category(); |
| 80 | - $info['url'] = $this->user['domain'] . $info['alias']; | ||
| 81 | $this->response('success',Code::SUCCESS,$info); | 80 | $this->response('success',Code::SUCCESS,$info); |
| 82 | } | 81 | } |
| 83 | 82 |
| @@ -133,7 +133,6 @@ class NewsController extends BaseController | @@ -133,7 +133,6 @@ class NewsController extends BaseController | ||
| 133 | 'id.required' => 'ID不能为空', | 133 | 'id.required' => 'ID不能为空', |
| 134 | ]); | 134 | ]); |
| 135 | $info = $newsLogic->newsInfo(); | 135 | $info = $newsLogic->newsInfo(); |
| 136 | - | ||
| 137 | $this->response('success',Code::SUCCESS,$info); | 136 | $this->response('success',Code::SUCCESS,$info); |
| 138 | } | 137 | } |
| 139 | 138 |
| @@ -96,7 +96,7 @@ class BlogCategoryLogic extends BaseLogic | @@ -96,7 +96,7 @@ class BlogCategoryLogic extends BaseLogic | ||
| 96 | } | 96 | } |
| 97 | //查询当前分类下是否有商品 | 97 | //查询当前分类下是否有商品 |
| 98 | $blogModel = new BlogModel(); | 98 | $blogModel = new BlogModel(); |
| 99 | - $info = $blogModel->read(['id'=>['like','%,'.$id.',%']],['id']); | 99 | + $info = $blogModel->read(['category_id'=>['like','%,'.$id.',%']],['id']); |
| 100 | if($info !== false){ | 100 | if($info !== false){ |
| 101 | $this->fail('当前分类下已存在博客,请先把博客移除当前分类,在修改'); | 101 | $this->fail('当前分类下已存在博客,请先把博客移除当前分类,在修改'); |
| 102 | } | 102 | } |
| @@ -47,6 +47,7 @@ class NewsCategoryLogic extends BaseLogic | @@ -47,6 +47,7 @@ class NewsCategoryLogic extends BaseLogic | ||
| 47 | */ | 47 | */ |
| 48 | public function info_news_category(){ | 48 | public function info_news_category(){ |
| 49 | $info = $this->model->read($this->param); | 49 | $info = $this->model->read($this->param); |
| 50 | + $info['url'] = $this->user['domain'] . $info['alias']; | ||
| 50 | return $this->success($info); | 51 | return $this->success($info); |
| 51 | } | 52 | } |
| 52 | 53 | ||
| @@ -125,7 +126,7 @@ class NewsCategoryLogic extends BaseLogic | @@ -125,7 +126,7 @@ class NewsCategoryLogic extends BaseLogic | ||
| 125 | } | 126 | } |
| 126 | //查询当前分类下是否有商品 | 127 | //查询当前分类下是否有商品 |
| 127 | $newsModel = new NewsModel(); | 128 | $newsModel = new NewsModel(); |
| 128 | - $info = $newsModel->read(['id'=>['like','%,'.$id.',%']]); | 129 | + $info = $newsModel->read(['category_id'=>['like','%,'.$id.',%']]); |
| 129 | if($info !== false){ | 130 | if($info !== false){ |
| 130 | $this->fail('当前分类下已存在新闻,不允许修改上级'); | 131 | $this->fail('当前分类下已存在新闻,不允许修改上级'); |
| 131 | } | 132 | } |
-
请 注册 或 登录 后发表评论