正在显示
5 个修改的文件
包含
22 行增加
和
16 行删除
| @@ -49,7 +49,7 @@ class BlogCategoryController extends BaseController | @@ -49,7 +49,7 @@ class BlogCategoryController extends BaseController | ||
| 49 | public function add(BlogCategoryRequest $request,BlogCategoryModel $blogCategoryModel,BlogModel $blogModel){ | 49 | public function add(BlogCategoryRequest $request,BlogCategoryModel $blogCategoryModel,BlogModel $blogModel){ |
| 50 | $request->validated(); | 50 | $request->validated(); |
| 51 | $this->param['project_id'] = $this->user['project_id']; | 51 | $this->param['project_id'] = $this->user['project_id']; |
| 52 | - $this->param['Operator_id'] = $this->uid; | 52 | + $this->param['operator_id'] = $this->uid; |
| 53 | $this->param['create_id'] = $this->uid; | 53 | $this->param['create_id'] = $this->uid; |
| 54 | DB::beginTransaction(); | 54 | DB::beginTransaction(); |
| 55 | $rs = $blogCategoryModel->add($this->param); | 55 | $rs = $blogCategoryModel->add($this->param); |
| @@ -91,7 +91,7 @@ class BlogCategoryController extends BaseController | @@ -91,7 +91,7 @@ class BlogCategoryController extends BaseController | ||
| 91 | ],[ | 91 | ],[ |
| 92 | 'id.required' => 'ID不能为空' | 92 | 'id.required' => 'ID不能为空' |
| 93 | ]); | 93 | ]); |
| 94 | - $this->param['Operator_id'] = $this->uid; | 94 | + $this->param['operator_id'] = $this->uid; |
| 95 | $rs = $blogCategoryModel->edit($this->param,['id'=>$this->param['id']]); | 95 | $rs = $blogCategoryModel->edit($this->param,['id'=>$this->param['id']]); |
| 96 | if($rs === false){ | 96 | if($rs === false){ |
| 97 | $this->response('error',Code::USER_ERROR); | 97 | $this->response('error',Code::USER_ERROR); |
| @@ -112,7 +112,7 @@ class BlogCategoryController extends BaseController | @@ -112,7 +112,7 @@ class BlogCategoryController extends BaseController | ||
| 112 | ],[ | 112 | ],[ |
| 113 | 'id.required' => 'ID不能为空', | 113 | 'id.required' => 'ID不能为空', |
| 114 | ]); | 114 | ]); |
| 115 | - $this->param['Operator_id'] = $this->uid; | 115 | + $this->param['operator_id'] = $this->uid; |
| 116 | $rs = $blogCategoryModel->edit($this->param,['id'=>$this->param['id']]); | 116 | $rs = $blogCategoryModel->edit($this->param,['id'=>$this->param['id']]); |
| 117 | if($rs === false){ | 117 | if($rs === false){ |
| 118 | $this->response('error',Code::USER_ERROR); | 118 | $this->response('error',Code::USER_ERROR); |
| @@ -50,7 +50,7 @@ class BlogController extends BaseController | @@ -50,7 +50,7 @@ class BlogController extends BaseController | ||
| 50 | public function add(BlogRequest $request,BlogModel $blogModel){ | 50 | public function add(BlogRequest $request,BlogModel $blogModel){ |
| 51 | $request->validated(); | 51 | $request->validated(); |
| 52 | $this->param['create_id'] = $this->uid; | 52 | $this->param['create_id'] = $this->uid; |
| 53 | - $this->param['Operator_id'] = $this->uid; | 53 | + $this->param['operator_id'] = $this->uid; |
| 54 | $this->param['project_id'] = $this->user['project_id']; | 54 | $this->param['project_id'] = $this->user['project_id']; |
| 55 | //TODO::路由映射 | 55 | //TODO::路由映射 |
| 56 | $rs = $blogModel->add($this->param); | 56 | $rs = $blogModel->add($this->param); |
| @@ -95,7 +95,7 @@ class BlogController extends BaseController | @@ -95,7 +95,7 @@ class BlogController extends BaseController | ||
| 95 | ],[ | 95 | ],[ |
| 96 | 'id.required' => 'ID不能为空', | 96 | 'id.required' => 'ID不能为空', |
| 97 | ]); | 97 | ]); |
| 98 | - $this->param['Operator_id'] = $this->uid; | 98 | + $this->param['operator_id'] = $this->uid; |
| 99 | $rs = $blogModel->edit($this->param,['id'=>$this->param['id']]); | 99 | $rs = $blogModel->edit($this->param,['id'=>$this->param['id']]); |
| 100 | if($rs === false){ | 100 | if($rs === false){ |
| 101 | $this->response('error',Code::USER_ERROR); | 101 | $this->response('error',Code::USER_ERROR); |
| @@ -20,7 +20,7 @@ class NewsCategoryController extends BaseController | @@ -20,7 +20,7 @@ class NewsCategoryController extends BaseController | ||
| 20 | */ | 20 | */ |
| 21 | public function lists(NewsCategoryModel $newsCategory){ | 21 | public function lists(NewsCategoryModel $newsCategory){ |
| 22 | //搜索条件 | 22 | //搜索条件 |
| 23 | - $lists = $newsCategory->lists($this->map,$this->page,$this->row); | 23 | + $lists = $newsCategory->lists($this->map,$this->page,$this->row,$this->order); |
| 24 | $this->response('success',Code::SUCCESS,$lists); | 24 | $this->response('success',Code::SUCCESS,$lists); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| @@ -51,7 +51,7 @@ class NewsCategoryController extends BaseController | @@ -51,7 +51,7 @@ class NewsCategoryController extends BaseController | ||
| 51 | public function add(NewsCategoryRequest $request,NewsCategoryModel $newsCategoryModel,NewsModel $newsModel){ | 51 | public function add(NewsCategoryRequest $request,NewsCategoryModel $newsCategoryModel,NewsModel $newsModel){ |
| 52 | $request->validated(); | 52 | $request->validated(); |
| 53 | $this->param['project_id'] = $this->user['project_id']; | 53 | $this->param['project_id'] = $this->user['project_id']; |
| 54 | - $this->param['Operator_id'] = $this->uid; | 54 | + $this->param['operator_id'] = $this->uid; |
| 55 | $this->param['create_id'] = $this->uid; | 55 | $this->param['create_id'] = $this->uid; |
| 56 | DB::beginTransaction(); | 56 | DB::beginTransaction(); |
| 57 | $rs = $newsCategoryModel->add($this->param); | 57 | $rs = $newsCategoryModel->add($this->param); |
| @@ -93,7 +93,7 @@ class NewsCategoryController extends BaseController | @@ -93,7 +93,7 @@ class NewsCategoryController extends BaseController | ||
| 93 | ],[ | 93 | ],[ |
| 94 | 'id.required' => 'ID不能为空' | 94 | 'id.required' => 'ID不能为空' |
| 95 | ]); | 95 | ]); |
| 96 | - $this->param['Operator_id'] = $this->uid; | 96 | + $this->param['operator_id'] = $this->uid; |
| 97 | $rs = $newsCategory->edit($this->param,['id'=>$this->param['id']]); | 97 | $rs = $newsCategory->edit($this->param,['id'=>$this->param['id']]); |
| 98 | if($rs === false){ | 98 | if($rs === false){ |
| 99 | $this->response('error',Code::USER_ERROR); | 99 | $this->response('error',Code::USER_ERROR); |
| @@ -114,7 +114,7 @@ class NewsCategoryController extends BaseController | @@ -114,7 +114,7 @@ class NewsCategoryController extends BaseController | ||
| 114 | ],[ | 114 | ],[ |
| 115 | 'id.required' => 'ID不能为空', | 115 | 'id.required' => 'ID不能为空', |
| 116 | ]); | 116 | ]); |
| 117 | - $this->param['Operator_id'] = $this->uid; | 117 | + $this->param['operator_id'] = $this->uid; |
| 118 | $rs = $newsCategory->edit($this->param,['id'=>$this->param['id']]); | 118 | $rs = $newsCategory->edit($this->param,['id'=>$this->param['id']]); |
| 119 | if($rs === false){ | 119 | if($rs === false){ |
| 120 | $this->response('error',Code::USER_ERROR); | 120 | $this->response('error',Code::USER_ERROR); |
| @@ -9,6 +9,9 @@ use App\Models\News\News as NewsModel; | @@ -9,6 +9,9 @@ use App\Models\News\News as NewsModel; | ||
| 9 | use App\Models\News\NewsCategory as NewsCategoryModel; | 9 | use App\Models\News\NewsCategory as NewsCategoryModel; |
| 10 | use Illuminate\Http\Request; | 10 | use Illuminate\Http\Request; |
| 11 | 11 | ||
| 12 | +/** | ||
| 13 | + * @name:新闻管理 | ||
| 14 | + */ | ||
| 12 | class NewsController extends BaseController | 15 | class NewsController extends BaseController |
| 13 | { | 16 | { |
| 14 | /** | 17 | /** |
| @@ -18,6 +21,7 @@ class NewsController extends BaseController | @@ -18,6 +21,7 @@ class NewsController extends BaseController | ||
| 18 | * @method | 21 | * @method |
| 19 | */ | 22 | */ |
| 20 | public function lists(NewsModel $news){ | 23 | public function lists(NewsModel $news){ |
| 24 | + $this->map['project_id'] = $this->user['project_id']; | ||
| 21 | $lists = $news->lists($this->map,$this->page,$this->row,$this->order); | 25 | $lists = $news->lists($this->map,$this->page,$this->row,$this->order); |
| 22 | $this->response('success',Code::SUCCESS,$lists); | 26 | $this->response('success',Code::SUCCESS,$lists); |
| 23 | } | 27 | } |
| @@ -29,6 +33,8 @@ class NewsController extends BaseController | @@ -29,6 +33,8 @@ class NewsController extends BaseController | ||
| 29 | * @method | 33 | * @method |
| 30 | */ | 34 | */ |
| 31 | public function get_category_list(NewsCategoryModel $newsCategoryModel){ | 35 | public function get_category_list(NewsCategoryModel $newsCategoryModel){ |
| 36 | + $this->map['status'] = 0; | ||
| 37 | + $this->map['project_id'] = $this->user['project_id']; | ||
| 32 | $cate_list = $newsCategoryModel->list($this->map,'sort'); | 38 | $cate_list = $newsCategoryModel->list($this->map,'sort'); |
| 33 | if($cate_list === false){ | 39 | if($cate_list === false){ |
| 34 | $this->response('error',Code::USER_ERROR); | 40 | $this->response('error',Code::USER_ERROR); |
| @@ -41,7 +47,7 @@ class NewsController extends BaseController | @@ -41,7 +47,7 @@ class NewsController extends BaseController | ||
| 41 | $list[] = $v; | 47 | $list[] = $v; |
| 42 | } | 48 | } |
| 43 | } | 49 | } |
| 44 | - $this->response('当前用户菜单列表',Code::SUCCESS,$list); | 50 | + $this->response('success',Code::SUCCESS,$list); |
| 45 | } | 51 | } |
| 46 | /** | 52 | /** |
| 47 | * @name :获取详情 | 53 | * @name :获取详情 |
| @@ -71,7 +77,7 @@ class NewsController extends BaseController | @@ -71,7 +77,7 @@ class NewsController extends BaseController | ||
| 71 | public function add(NewsRequest $newsRequest,NewsModel $news){ | 77 | public function add(NewsRequest $newsRequest,NewsModel $news){ |
| 72 | $newsRequest->validated(); | 78 | $newsRequest->validated(); |
| 73 | $this->param['create_id'] = $this->uid; | 79 | $this->param['create_id'] = $this->uid; |
| 74 | - $this->param['Operator_id'] = $this->uid; | 80 | + $this->param['operator_id'] = $this->uid; |
| 75 | $this->param['project_id'] = $this->user['project_id']; | 81 | $this->param['project_id'] = $this->user['project_id']; |
| 76 | //TODO::路由映射 | 82 | //TODO::路由映射 |
| 77 | $rs = $news->add($this->param); | 83 | $rs = $news->add($this->param); |
| @@ -94,7 +100,7 @@ class NewsController extends BaseController | @@ -94,7 +100,7 @@ class NewsController extends BaseController | ||
| 94 | ],[ | 100 | ],[ |
| 95 | 'id.required' => 'ID不能为空', | 101 | 'id.required' => 'ID不能为空', |
| 96 | ]); | 102 | ]); |
| 97 | - $this->param['Operator_id'] = $this->uid; | 103 | + $this->param['operator_id'] = $this->uid; |
| 98 | $rs = $news->edit($this->param,['id'=>$this->param['id']]); | 104 | $rs = $news->edit($this->param,['id'=>$this->param['id']]); |
| 99 | if($rs === false){ | 105 | if($rs === false){ |
| 100 | $this->response('error',Code::USER_ERROR); | 106 | $this->response('error',Code::USER_ERROR); |
| @@ -115,7 +121,7 @@ class NewsController extends BaseController | @@ -115,7 +121,7 @@ class NewsController extends BaseController | ||
| 115 | ],[ | 121 | ],[ |
| 116 | 'id.required' => 'ID不能为空', | 122 | 'id.required' => 'ID不能为空', |
| 117 | ]); | 123 | ]); |
| 118 | - $this->param['Operator_id'] = $this->uid; | 124 | + $this->param['operator_id'] = $this->uid; |
| 119 | $rs = $news->edit($this->param,['id'=>$this->param['id']]); | 125 | $rs = $news->edit($this->param,['id'=>$this->param['id']]); |
| 120 | if($rs === false){ | 126 | if($rs === false){ |
| 121 | $this->response('error',Code::USER_ERROR); | 127 | $this->response('error',Code::USER_ERROR); |
| @@ -135,8 +141,8 @@ class NewsController extends BaseController | @@ -135,8 +141,8 @@ class NewsController extends BaseController | ||
| 135 | ],[ | 141 | ],[ |
| 136 | 'id.required' => 'ID不能为空', | 142 | 'id.required' => 'ID不能为空', |
| 137 | ]); | 143 | ]); |
| 138 | - $this->param['id'] = ['in',$this->param['id']]; | ||
| 139 | - $rs = $news->edit(['status'=>2],$this->param); | 144 | + $this->param['id'] = ['in',$this->param['id']];d; |
| 145 | + $rs = $news->edit(['status'=>2,'operator_id'=>$this->uid],$this->param); | ||
| 140 | if($rs === false){ | 146 | if($rs === false){ |
| 141 | $this->response('error',Code::USER_ERROR); | 147 | $this->response('error',Code::USER_ERROR); |
| 142 | } | 148 | } |
| @@ -47,10 +47,10 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -47,10 +47,10 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 47 | //新闻相关路由 | 47 | //新闻相关路由 |
| 48 | Route::prefix('news')->group(function () { | 48 | Route::prefix('news')->group(function () { |
| 49 | //分类 | 49 | //分类 |
| 50 | + Route::any('/category/', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'lists'])->name('news_category_lists'); | ||
| 50 | Route::any('/category/add', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'add'])->name('news_category_add'); | 51 | Route::any('/category/add', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'add'])->name('news_category_add'); |
| 51 | Route::any('/category/info', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'info'])->name('news_category_info'); | 52 | Route::any('/category/info', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'info'])->name('news_category_info'); |
| 52 | Route::any('/category/edit', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'edit'])->name('news_category_edit'); | 53 | Route::any('/category/edit', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'edit'])->name('news_category_edit'); |
| 53 | - Route::any('/category/lists', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'lists'])->name('news_category_lists'); | ||
| 54 | Route::any('/category/del', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'del'])->name('news_category_del'); | 54 | Route::any('/category/del', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'del'])->name('news_category_del'); |
| 55 | Route::any('/category/status', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'status'])->name('news_category_status'); | 55 | Route::any('/category/status', [\App\Http\Controllers\Bside\News\NewsCategoryController::class, 'status'])->name('news_category_status'); |
| 56 | 56 |
-
请 注册 或 登录 后发表评论