正在显示
25 个修改的文件
包含
73 行增加
和
88 行删除
| @@ -96,8 +96,8 @@ class BlogCategoryController extends BaseController | @@ -96,8 +96,8 @@ class BlogCategoryController extends BaseController | ||
| 96 | */ | 96 | */ |
| 97 | public function save(BlogCategoryRequest $request,BlogCategoryLogic $blogCategoryLogic){ | 97 | public function save(BlogCategoryRequest $request,BlogCategoryLogic $blogCategoryLogic){ |
| 98 | $request->validated(); | 98 | $request->validated(); |
| 99 | - $blogCategoryLogic->categorySave(); | ||
| 100 | - $this->response('success'); | 99 | + $data = $blogCategoryLogic->categorySave(); |
| 100 | + $this->response('success',Code::SUCCESS,$data); | ||
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | 103 |
| @@ -198,8 +198,8 @@ class BlogController extends BaseController | @@ -198,8 +198,8 @@ class BlogController extends BaseController | ||
| 198 | */ | 198 | */ |
| 199 | public function save(BlogRequest $request,BlogLogic $blogLogic){ | 199 | public function save(BlogRequest $request,BlogLogic $blogLogic){ |
| 200 | $request->validated(); | 200 | $request->validated(); |
| 201 | - $blogLogic->blogSave(); | ||
| 202 | - $this->response('success'); | 201 | + $data = $blogLogic->blogSave(); |
| 202 | + $this->response('success',Code::SUCCESS,$data); | ||
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | /** | 205 | /** |
| @@ -30,8 +30,8 @@ class BlogLabelController extends BaseController | @@ -30,8 +30,8 @@ class BlogLabelController extends BaseController | ||
| 30 | */ | 30 | */ |
| 31 | public function add(BlogLabelRequest $request,BlogLabelLogic $blogLabelLogic){ | 31 | public function add(BlogLabelRequest $request,BlogLabelLogic $blogLabelLogic){ |
| 32 | $request->validated(); | 32 | $request->validated(); |
| 33 | - $blogLabelLogic->add_blog_label(); | ||
| 34 | - $this->response('success'); | 33 | + $data = $blogLabelLogic->add_blog_label(); |
| 34 | + $this->response('success',Code::SUCCESS,$data); | ||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| @@ -63,8 +63,8 @@ class BlogLabelController extends BaseController | @@ -63,8 +63,8 @@ class BlogLabelController extends BaseController | ||
| 63 | ],[ | 63 | ],[ |
| 64 | 'id.required' => 'ID不能为空' | 64 | 'id.required' => 'ID不能为空' |
| 65 | ]); | 65 | ]); |
| 66 | - $blogLabelLogic->edit_blog_label(); | ||
| 67 | - $this->response('success'); | 66 | + $data = $blogLabelLogic->edit_blog_label(); |
| 67 | + $this->response('success',Code::SUCCESS,$data); | ||
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | /** | 70 | /** |
| @@ -135,8 +135,8 @@ class CustomModuleCategoryController extends BaseController | @@ -135,8 +135,8 @@ class CustomModuleCategoryController extends BaseController | ||
| 135 | 'module_id.required' => '所选模块id不能为空', | 135 | 'module_id.required' => '所选模块id不能为空', |
| 136 | 'pid.required' => '上级不能为空' | 136 | 'pid.required' => '上级不能为空' |
| 137 | ]); | 137 | ]); |
| 138 | - $logic->categorySave(); | ||
| 139 | - $this->response('success'); | 138 | + $data = $logic->categorySave(); |
| 139 | + $this->response('success',Code::SUCCESS,$data); | ||
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | /** | 142 | /** |
| @@ -204,8 +204,8 @@ class CustomModuleContentController extends BaseController | @@ -204,8 +204,8 @@ class CustomModuleContentController extends BaseController | ||
| 204 | 'route.required' => '分类路由不能为空', | 204 | 'route.required' => '分类路由不能为空', |
| 205 | 'module_id.required' => '所选模块id不能为空' | 205 | 'module_id.required' => '所选模块id不能为空' |
| 206 | ]); | 206 | ]); |
| 207 | - $logic->contentSave(); | ||
| 208 | - $this->response('success'); | 207 | + $data = $logic->contentSave(); |
| 208 | + $this->response('success',Code::SUCCESS,$data); | ||
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | /** | 211 | /** |
| @@ -264,7 +264,7 @@ class CustomModuleContentController extends BaseController | @@ -264,7 +264,7 @@ class CustomModuleContentController extends BaseController | ||
| 264 | * @time :2024/4/28 16:31 | 264 | * @time :2024/4/28 16:31 |
| 265 | */ | 265 | */ |
| 266 | public function copyModuleContent(CustomModuleContentLogic $logic){ | 266 | public function copyModuleContent(CustomModuleContentLogic $logic){ |
| 267 | - $logic->copyModuleContentInfo(); | ||
| 268 | - $this->response('success'); | 267 | + $data = $logic->copyModuleContentInfo(); |
| 268 | + $this->response('success',Code::SUCCESS,$data); | ||
| 269 | } | 269 | } |
| 270 | } | 270 | } |
| @@ -67,8 +67,8 @@ class CustomModuleController extends BaseController | @@ -67,8 +67,8 @@ class CustomModuleController extends BaseController | ||
| 67 | ],[ | 67 | ],[ |
| 68 | 'name.required' => '模块名称不能为空', | 68 | 'name.required' => '模块名称不能为空', |
| 69 | ]); | 69 | ]); |
| 70 | - $logic->customModuleSave(); | ||
| 71 | - $this->response('success'); | 70 | + $data = $logic->customModuleSave(); |
| 71 | + $this->response('success',Code::SUCCESS,$data); | ||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | /** | 74 | /** |
| @@ -85,8 +85,8 @@ class NavController extends BaseController | @@ -85,8 +85,8 @@ class NavController extends BaseController | ||
| 85 | */ | 85 | */ |
| 86 | public function save(NavRequest $request,NavLogic $logic){ | 86 | public function save(NavRequest $request,NavLogic $logic){ |
| 87 | $request->validated(); | 87 | $request->validated(); |
| 88 | - $logic->navSave(); | ||
| 89 | - $this->response('success'); | 88 | + $data = $logic->navSave(); |
| 89 | + $this->response('success',Code::SUCCESS,$data); | ||
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | 92 |
| @@ -96,8 +96,8 @@ class NewsCategoryController extends BaseController | @@ -96,8 +96,8 @@ class NewsCategoryController extends BaseController | ||
| 96 | */ | 96 | */ |
| 97 | public function save(NewsCategoryRequest $request,NewsCategoryLogic $newsCategoryLogic){ | 97 | public function save(NewsCategoryRequest $request,NewsCategoryLogic $newsCategoryLogic){ |
| 98 | $request->validated(); | 98 | $request->validated(); |
| 99 | - $newsCategoryLogic->newsCategorySave(); | ||
| 100 | - $this->response('success'); | 99 | + $data = $newsCategoryLogic->newsCategorySave(); |
| 100 | + $this->response('success',Code::SUCCESS,$data); | ||
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | /** | 103 | /** |
| @@ -190,8 +190,8 @@ class NewsController extends BaseController | @@ -190,8 +190,8 @@ class NewsController extends BaseController | ||
| 190 | */ | 190 | */ |
| 191 | public function save(NewsRequest $newsRequest,NewsLogic $newsLogic){ | 191 | public function save(NewsRequest $newsRequest,NewsLogic $newsLogic){ |
| 192 | $newsRequest->validated(); | 192 | $newsRequest->validated(); |
| 193 | - $newsLogic->newsSave(); | ||
| 194 | - $this->response('success'); | 193 | + $data = $newsLogic->newsSave(); |
| 194 | + $this->response('success',Code::SUCCESS,$data); | ||
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | 197 |
| @@ -126,8 +126,8 @@ class CategoryController extends BaseController | @@ -126,8 +126,8 @@ class CategoryController extends BaseController | ||
| 126 | public function save(CategoryRequest $request, CategoryLogic $logic) | 126 | public function save(CategoryRequest $request, CategoryLogic $logic) |
| 127 | { | 127 | { |
| 128 | $request->validated(); | 128 | $request->validated(); |
| 129 | - $logic->categorySave(); | ||
| 130 | - $this->response('success'); | 129 | + $data = $logic->categorySave(); |
| 130 | + $this->response('success',Code::SUCCESS,$data); | ||
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | /** | 133 | /** |
| @@ -378,8 +378,8 @@ class ProductController extends BaseController | @@ -378,8 +378,8 @@ class ProductController extends BaseController | ||
| 378 | public function save(ProductRequest $request, ProductLogic $logic) | 378 | public function save(ProductRequest $request, ProductLogic $logic) |
| 379 | { | 379 | { |
| 380 | $request->validated(); | 380 | $request->validated(); |
| 381 | - $logic->productSave(); | ||
| 382 | - $this->response('success'); | 381 | + $data = $logic->productSave(); |
| 382 | + $this->response('success',Code::SUCCESS,$data); | ||
| 383 | } | 383 | } |
| 384 | 384 | ||
| 385 | /** | 385 | /** |
| @@ -74,8 +74,8 @@ class CustomTemplateController extends BaseController | @@ -74,8 +74,8 @@ class CustomTemplateController extends BaseController | ||
| 74 | */ | 74 | */ |
| 75 | public function save(CustomTemplateRequest $customTemplateRequest,CustomTemplateLogic $customTemplateLogic){ | 75 | public function save(CustomTemplateRequest $customTemplateRequest,CustomTemplateLogic $customTemplateLogic){ |
| 76 | $customTemplateRequest->validated(); | 76 | $customTemplateRequest->validated(); |
| 77 | - $customTemplateLogic->customTemplateSave(); | ||
| 78 | - $this->response('success'); | 77 | + $data = $customTemplateLogic->customTemplateSave(); |
| 78 | + $this->response('success',Code::SUCCESS,$data); | ||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | /** | 81 | /** |
| @@ -65,13 +65,14 @@ class CustomTemplateLogic extends BaseLogic | @@ -65,13 +65,14 @@ class CustomTemplateLogic extends BaseLogic | ||
| 65 | public function customTemplateSave(){ | 65 | public function customTemplateSave(){ |
| 66 | $this->param['url'] = str_replace_url($this->param['url']); | 66 | $this->param['url'] = str_replace_url($this->param['url']); |
| 67 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 67 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 68 | + $id = $this->param['id']; | ||
| 68 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 | 69 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 |
| 69 | $six_read = $this->param['six_read'] ?? 0;//5.0数据时,是否按6.0显示 | 70 | $six_read = $this->param['six_read'] ?? 0;//5.0数据时,是否按6.0显示 |
| 70 | if($is_upgrade == 0 || $six_read == 1) { | 71 | if($is_upgrade == 0 || $six_read == 1) { |
| 71 | - $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $this->param['id'], $this->user['project_id']); | 72 | + $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_PAGE, $id, $this->user['project_id']); |
| 72 | } | 73 | } |
| 73 | $this->editCustomRoute($this->param['url']); | 74 | $this->editCustomRoute($this->param['url']); |
| 74 | - $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); | 75 | + $rs = $this->model->edit($this->param,['id'=>$id]); |
| 75 | }else{ | 76 | }else{ |
| 76 | if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){ | 77 | if($this->param['url'] == $this->model::NOT_FOUND_PAGE_URL){ |
| 77 | $this->fail('404页面已存在'); | 78 | $this->fail('404页面已存在'); |
| @@ -85,7 +86,7 @@ class CustomTemplateLogic extends BaseLogic | @@ -85,7 +86,7 @@ class CustomTemplateLogic extends BaseLogic | ||
| 85 | if($rs === false){ | 86 | if($rs === false){ |
| 86 | $this->fail('保存失败,请联系管理员'); | 87 | $this->fail('保存失败,请联系管理员'); |
| 87 | } | 88 | } |
| 88 | - return $this->success(); | 89 | + return $this->success(['id'=>$id]); |
| 89 | } | 90 | } |
| 90 | 91 | ||
| 91 | /** | 92 | /** |
| @@ -36,10 +36,11 @@ class BlogCategoryLogic extends BaseLogic | @@ -36,10 +36,11 @@ class BlogCategoryLogic extends BaseLogic | ||
| 36 | DB::beginTransaction(); | 36 | DB::beginTransaction(); |
| 37 | try { | 37 | try { |
| 38 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 38 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 39 | - $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_BLOG_CATE, $this->param['id'], $this->user['project_id']); | 39 | + $id = $this->param['id']; |
| 40 | + $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']); | ||
| 40 | $route = $this->param['alias']; | 41 | $route = $this->param['alias']; |
| 41 | $this->param['operator_id'] = $this->user['id']; | 42 | $this->param['operator_id'] = $this->user['id']; |
| 42 | - $this->edit($this->param,['id'=>$this->param['id']]); | 43 | + $this->edit($this->param,['id'=>$id]); |
| 43 | }else{ | 44 | }else{ |
| 44 | //路由拼接 | 45 | //路由拼接 |
| 45 | if(!isset($this->param['alias']) || empty($this->param['alias'])){ | 46 | if(!isset($this->param['alias']) || empty($this->param['alias'])){ |
| @@ -58,7 +59,7 @@ class BlogCategoryLogic extends BaseLogic | @@ -58,7 +59,7 @@ class BlogCategoryLogic extends BaseLogic | ||
| 58 | } | 59 | } |
| 59 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG_CATE,$route); | 60 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG_CATE,$route); |
| 60 | $this->curlDelRoute(['new_route'=>$route]); | 61 | $this->curlDelRoute(['new_route'=>$route]); |
| 61 | - return $this->success(); | 62 | + return $this->success(['id'=>$id]); |
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | /** | 65 | /** |
| @@ -42,11 +42,8 @@ class BlogLabelLogic extends BaseLogic | @@ -42,11 +42,8 @@ class BlogLabelLogic extends BaseLogic | ||
| 42 | $this->param['create_id'] = $this->user['id']; | 42 | $this->param['create_id'] = $this->user['id']; |
| 43 | $this->param['operator_id'] = $this->user['id']; | 43 | $this->param['operator_id'] = $this->user['id']; |
| 44 | $this->param['project_id'] = $this->user['project_id']; | 44 | $this->param['project_id'] = $this->user['project_id']; |
| 45 | - $rs = $this->model->add($this->param); | ||
| 46 | - if($rs === false){ | ||
| 47 | - $this->fail('error'); | ||
| 48 | - } | ||
| 49 | - return $this->success(); | 45 | + $id = $this->model->addReturnId($this->param); |
| 46 | + return $this->success(['id'=>$id]); | ||
| 50 | } | 47 | } |
| 51 | 48 | ||
| 52 | /** | 49 | /** |
| @@ -62,7 +59,7 @@ class BlogLabelLogic extends BaseLogic | @@ -62,7 +59,7 @@ class BlogLabelLogic extends BaseLogic | ||
| 62 | if($rs === false){ | 59 | if($rs === false){ |
| 63 | $this->fail('error'); | 60 | $this->fail('error'); |
| 64 | } | 61 | } |
| 65 | - return $this->success(); | 62 | + return $this->success(['id'=>$this->param['id']]); |
| 66 | } | 63 | } |
| 67 | 64 | ||
| 68 | /** | 65 | /** |
| @@ -34,13 +34,14 @@ class BlogLogic extends BaseLogic | @@ -34,13 +34,14 @@ class BlogLogic extends BaseLogic | ||
| 34 | try { | 34 | try { |
| 35 | $this->param = $this->paramProcessing($this->param); | 35 | $this->param = $this->paramProcessing($this->param); |
| 36 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 36 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 37 | + $id = $this->param['id']; | ||
| 37 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 | 38 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 |
| 38 | $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 | 39 | $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 |
| 39 | if($is_upgrade == 0 || $six_read == 1){ | 40 | if($is_upgrade == 0 || $six_read == 1){ |
| 40 | - $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $this->param['id'], $this->user['project_id']); | 41 | + $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); |
| 41 | } | 42 | } |
| 42 | $route = $this->param['url']; | 43 | $route = $this->param['url']; |
| 43 | - $this->edit($this->param,['id'=>$this->param['id']]); | 44 | + $this->edit($this->param,['id'=>$id]); |
| 44 | }else{ | 45 | }else{ |
| 45 | $this->param['sort'] = $this->setNewsSort(); | 46 | $this->param['sort'] = $this->setNewsSort(); |
| 46 | $id = $this->model->addReturnId($this->param); | 47 | $id = $this->model->addReturnId($this->param); |
| @@ -54,7 +55,7 @@ class BlogLogic extends BaseLogic | @@ -54,7 +55,7 @@ class BlogLogic extends BaseLogic | ||
| 54 | } | 55 | } |
| 55 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); | 56 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); |
| 56 | $this->curlDelRoute(['new_route'=>$route]); | 57 | $this->curlDelRoute(['new_route'=>$route]); |
| 57 | - return $this->success(); | 58 | + return $this->success(['id'=>$id]); |
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | /** | 61 | /** |
| @@ -98,11 +98,11 @@ class CustomModuleCategoryLogic extends BaseLogic | @@ -98,11 +98,11 @@ class CustomModuleCategoryLogic extends BaseLogic | ||
| 98 | public function categorySave(){ | 98 | public function categorySave(){ |
| 99 | $this->param = $this->handleParam($this->param); | 99 | $this->param = $this->handleParam($this->param); |
| 100 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 100 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 101 | - $this->categoryEdit(); | 101 | + $data = $this->categoryEdit(); |
| 102 | }else{ | 102 | }else{ |
| 103 | - $this->categoryAdd(); | 103 | + $data = $this->categoryAdd(); |
| 104 | } | 104 | } |
| 105 | - return $this->success(); | 105 | + return $this->success($data); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | /** | 108 | /** |
| @@ -141,7 +141,7 @@ class CustomModuleCategoryLogic extends BaseLogic | @@ -141,7 +141,7 @@ class CustomModuleCategoryLogic extends BaseLogic | ||
| 141 | }catch (\Exception $e){ | 141 | }catch (\Exception $e){ |
| 142 | $this->fail('系统错误,请联系管理员'); | 142 | $this->fail('系统错误,请联系管理员'); |
| 143 | } | 143 | } |
| 144 | - return $this->success(); | 144 | + return $this->success(['id'=>$id]); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | /** | 147 | /** |
| @@ -152,7 +152,6 @@ class CustomModuleCategoryLogic extends BaseLogic | @@ -152,7 +152,6 @@ class CustomModuleCategoryLogic extends BaseLogic | ||
| 152 | * @time :2023/12/5 10:55 | 152 | * @time :2023/12/5 10:55 |
| 153 | */ | 153 | */ |
| 154 | public function categoryEdit(){ | 154 | public function categoryEdit(){ |
| 155 | - | ||
| 156 | $route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_MODULE_CATE, | 155 | $route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_MODULE_CATE, |
| 157 | $this->param['id'], $this->user['project_id']); | 156 | $this->param['id'], $this->user['project_id']); |
| 158 | $this->editRoute($this->param['id'],$route); | 157 | $this->editRoute($this->param['id'],$route); |
| @@ -160,7 +159,7 @@ class CustomModuleCategoryLogic extends BaseLogic | @@ -160,7 +159,7 @@ class CustomModuleCategoryLogic extends BaseLogic | ||
| 160 | if($rs === false){ | 159 | if($rs === false){ |
| 161 | $this->fail('系统错误,请连续管理员'); | 160 | $this->fail('系统错误,请连续管理员'); |
| 162 | } | 161 | } |
| 163 | - return $this->success(); | 162 | + return $this->success(['id'=>$this->param['id']]); |
| 164 | } | 163 | } |
| 165 | 164 | ||
| 166 | /** | 165 | /** |
| @@ -262,7 +261,7 @@ class CustomModuleCategoryLogic extends BaseLogic | @@ -262,7 +261,7 @@ class CustomModuleCategoryLogic extends BaseLogic | ||
| 262 | $param = $this->setContentParams($info); | 261 | $param = $this->setContentParams($info); |
| 263 | $save_id = $this->model->insertGetId($param); | 262 | $save_id = $this->model->insertGetId($param); |
| 264 | $this->copyTemplate($this->param['id'],$info['project_id'],$save_id,$info['module_id']); | 263 | $this->copyTemplate($this->param['id'],$info['project_id'],$save_id,$info['module_id']); |
| 265 | - $this->response('success'); | 264 | + $this->success(['id'=>$save_id]); |
| 266 | } | 265 | } |
| 267 | 266 | ||
| 268 | /** | 267 | /** |
| @@ -121,7 +121,7 @@ class CustomModuleContentLogic extends BaseLogic | @@ -121,7 +121,7 @@ class CustomModuleContentLogic extends BaseLogic | ||
| 121 | } | 121 | } |
| 122 | //保存扩展字段 | 122 | //保存扩展字段 |
| 123 | $this->saveExtendInfo($id,$extend); | 123 | $this->saveExtendInfo($id,$extend); |
| 124 | - return $this->success(); | 124 | + return $this->success(['id'=>$id]); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | /** | 127 | /** |
| @@ -405,7 +405,7 @@ class CustomModuleContentLogic extends BaseLogic | @@ -405,7 +405,7 @@ class CustomModuleContentLogic extends BaseLogic | ||
| 405 | $param = $this->setContentParams($info); | 405 | $param = $this->setContentParams($info); |
| 406 | $save_id = $this->model->insertGetId($param); | 406 | $save_id = $this->model->insertGetId($param); |
| 407 | $this->copyTemplate($this->param['id'],$info['project_id'],$save_id,$info['module_id']); | 407 | $this->copyTemplate($this->param['id'],$info['project_id'],$save_id,$info['module_id']); |
| 408 | - $this->response('success'); | 408 | + $this->success(['id'=>$save_id]); |
| 409 | } | 409 | } |
| 410 | 410 | ||
| 411 | /** | 411 | /** |
| @@ -48,11 +48,11 @@ class CustomModuleLogic extends BaseLogic | @@ -48,11 +48,11 @@ class CustomModuleLogic extends BaseLogic | ||
| 48 | public function customModuleSave(){ | 48 | public function customModuleSave(){ |
| 49 | $this->param = $this->handleParam($this->param); | 49 | $this->param = $this->handleParam($this->param); |
| 50 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 50 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 51 | - $this->moduleEdit(); | 51 | + $data = $this->moduleEdit(); |
| 52 | }else{ | 52 | }else{ |
| 53 | - $this->moduleAdd(); | 53 | + $data['id'] = $this->model->addReturnId($this->param); |
| 54 | } | 54 | } |
| 55 | - return $this->success(); | 55 | + return $this->success($data); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | /** | 58 | /** |
| @@ -71,21 +71,6 @@ class CustomModuleLogic extends BaseLogic | @@ -71,21 +71,6 @@ class CustomModuleLogic extends BaseLogic | ||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | /** | 73 | /** |
| 74 | - * @remark :新增 | ||
| 75 | - * @name :moduleAdd | ||
| 76 | - * @author :lyh | ||
| 77 | - * @method :post | ||
| 78 | - * @time :2023/12/5 9:39 | ||
| 79 | - */ | ||
| 80 | - public function moduleAdd(){ | ||
| 81 | - $rs = $this->model->add($this->param); | ||
| 82 | - if($rs === false){ | ||
| 83 | - $this->fail('系统错误,请联系管理员'); | ||
| 84 | - } | ||
| 85 | - return $this->success(); | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - /** | ||
| 89 | * @remark :编辑 | 74 | * @remark :编辑 |
| 90 | * @name :moduleEdit | 75 | * @name :moduleEdit |
| 91 | * @author :lyh | 76 | * @author :lyh |
| @@ -97,7 +82,7 @@ class CustomModuleLogic extends BaseLogic | @@ -97,7 +82,7 @@ class CustomModuleLogic extends BaseLogic | ||
| 97 | if($rs === false){ | 82 | if($rs === false){ |
| 98 | $this->fail('系统错误,请联系管理员'); | 83 | $this->fail('系统错误,请联系管理员'); |
| 99 | } | 84 | } |
| 100 | - return $this->success(); | 85 | + return $this->success(['id'=>$this->param['id']]); |
| 101 | } | 86 | } |
| 102 | 87 | ||
| 103 | /** | 88 | /** |
| @@ -94,15 +94,16 @@ class NavLogic extends BaseLogic | @@ -94,15 +94,16 @@ class NavLogic extends BaseLogic | ||
| 94 | $data['image'] = str_replace_url(isset($this->param['image']) ? $this->param['image'] : ''); | 94 | $data['image'] = str_replace_url(isset($this->param['image']) ? $this->param['image'] : ''); |
| 95 | $data['remark_image'] = str_replace_url(isset($this->param['remark_image']) ? $this->param['remark_image'] : ''); | 95 | $data['remark_image'] = str_replace_url(isset($this->param['remark_image']) ? $this->param['remark_image'] : ''); |
| 96 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 96 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 97 | + $id = $this->param['id']; | ||
| 97 | $this->handleEditParam();//验证是否可编辑分类 | 98 | $this->handleEditParam();//验证是否可编辑分类 |
| 98 | - $this->model->edit($data,['id'=>$this->param['id']]); | 99 | + $this->model->edit($data,['id'=>$id]); |
| 99 | }else{ | 100 | }else{ |
| 100 | $data['project_id'] = $this->user['project_id']; | 101 | $data['project_id'] = $this->user['project_id']; |
| 101 | - $this->model->add($data); | 102 | + $id = $this->model->addReturnId($data); |
| 102 | } | 103 | } |
| 103 | //编辑菜单后,通知更新 | 104 | //编辑菜单后,通知更新 |
| 104 | $this->addUpdateNotify(RouteMap::SOURCE_NAV, 'all'); | 105 | $this->addUpdateNotify(RouteMap::SOURCE_NAV, 'all'); |
| 105 | - return $this->success(); | 106 | + return $this->success(['id'=>$id]); |
| 106 | } | 107 | } |
| 107 | 108 | ||
| 108 | /** | 109 | /** |
| @@ -47,10 +47,11 @@ class NewsCategoryLogic extends BaseLogic | @@ -47,10 +47,11 @@ class NewsCategoryLogic extends BaseLogic | ||
| 47 | DB::beginTransaction(); | 47 | DB::beginTransaction(); |
| 48 | try { | 48 | try { |
| 49 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 49 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 50 | - $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $this->param['id'], $this->user['project_id']); | 50 | + $id = $this->param['id']; |
| 51 | + $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); | ||
| 51 | $route = $this->param['alias']; | 52 | $route = $this->param['alias']; |
| 52 | $this->param['operator_id'] = $this->user['id']; | 53 | $this->param['operator_id'] = $this->user['id']; |
| 53 | - $this->edit($this->param,['id'=>$this->param['id']]); | 54 | + $this->edit($this->param,['id'=>$id]); |
| 54 | }else{ | 55 | }else{ |
| 55 | if(!isset($this->param['alias']) || empty($this->param['alias'])){ | 56 | if(!isset($this->param['alias']) || empty($this->param['alias'])){ |
| 56 | $this->param['alias'] = Translate::tran($this->param['name'], 'en'); | 57 | $this->param['alias'] = Translate::tran($this->param['name'], 'en'); |
| @@ -67,7 +68,7 @@ class NewsCategoryLogic extends BaseLogic | @@ -67,7 +68,7 @@ class NewsCategoryLogic extends BaseLogic | ||
| 67 | } | 68 | } |
| 68 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route); | 69 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route); |
| 69 | $this->curlDelRoute(['new_route'=>$route]); | 70 | $this->curlDelRoute(['new_route'=>$route]); |
| 70 | - return $this->success(); | 71 | + return $this->success(['id'=>$id]); |
| 71 | } | 72 | } |
| 72 | 73 | ||
| 73 | /** | 74 | /** |
| @@ -65,14 +65,15 @@ class NewsLogic extends BaseLogic | @@ -65,14 +65,15 @@ class NewsLogic extends BaseLogic | ||
| 65 | try { | 65 | try { |
| 66 | $this->param = $this->paramProcessing($this->param); | 66 | $this->param = $this->paramProcessing($this->param); |
| 67 | if (isset($this->param['id']) && !empty($this->param['id'])) { | 67 | if (isset($this->param['id']) && !empty($this->param['id'])) { |
| 68 | + $id = $this->param['id']; | ||
| 68 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 | 69 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 |
| 69 | $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 | 70 | $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 |
| 70 | if($is_upgrade == 0 || $six_read == 1) { | 71 | if($is_upgrade == 0 || $six_read == 1) { |
| 71 | - $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $this->param['id'], $this->user['project_id']); | 72 | + $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); |
| 72 | } | 73 | } |
| 73 | //是否更新路由 | 74 | //是否更新路由 |
| 74 | $route = $this->param['url']; | 75 | $route = $this->param['url']; |
| 75 | - $this->edit($this->param, ['id' => $this->param['id']]); | 76 | + $this->edit($this->param, ['id' => $id]); |
| 76 | } else { | 77 | } else { |
| 77 | $this->param['sort'] = $this->setNewsSort(); | 78 | $this->param['sort'] = $this->setNewsSort(); |
| 78 | $id = $this->model->addReturnId($this->param); | 79 | $id = $this->model->addReturnId($this->param); |
| @@ -87,7 +88,7 @@ class NewsLogic extends BaseLogic | @@ -87,7 +88,7 @@ class NewsLogic extends BaseLogic | ||
| 87 | } | 88 | } |
| 88 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); | 89 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); |
| 89 | $this->curlDelRoute(['new_route'=>$route]); | 90 | $this->curlDelRoute(['new_route'=>$route]); |
| 90 | - return $this->success(); | 91 | + return $this->success(['id'=>$id]); |
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | /** | 94 | /** |
| @@ -227,10 +228,6 @@ class NewsLogic extends BaseLogic | @@ -227,10 +228,6 @@ class NewsLogic extends BaseLogic | ||
| 227 | $str = ','.implode(',',$category).','; | 228 | $str = ','.implode(',',$category).','; |
| 228 | } | 229 | } |
| 229 | return $str; | 230 | return $str; |
| 230 | -// foreach ($category as $v){ | ||
| 231 | -// $str .= $v.','; | ||
| 232 | -// } | ||
| 233 | -// return !empty(trim($str,',')) ? ','.$str.',' : ''; | ||
| 234 | } | 231 | } |
| 235 | 232 | ||
| 236 | /** | 233 | /** |
| @@ -118,9 +118,10 @@ class CategoryLogic extends BaseLogic | @@ -118,9 +118,10 @@ class CategoryLogic extends BaseLogic | ||
| 118 | try { | 118 | try { |
| 119 | $this->param = $this->saveHandleParam($this->param); | 119 | $this->param = $this->saveHandleParam($this->param); |
| 120 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 120 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 121 | - $this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $this->param['id'], $this->user['project_id']); | 121 | + $id = $this->param['id']; |
| 122 | + $this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $id, $this->user['project_id']); | ||
| 122 | $route = $this->param['route']; | 123 | $route = $this->param['route']; |
| 123 | - $this->model->edit($this->param,['id'=>$this->param['id']]); | 124 | + $this->model->edit($this->param,['id'=>$id]); |
| 124 | }else{ | 125 | }else{ |
| 125 | $this->param['project_id'] = $this->user['project_id']; | 126 | $this->param['project_id'] = $this->user['project_id']; |
| 126 | $id = $this->model->addReturnId($this->param); | 127 | $id = $this->model->addReturnId($this->param); |
| @@ -136,7 +137,7 @@ class CategoryLogic extends BaseLogic | @@ -136,7 +137,7 @@ class CategoryLogic extends BaseLogic | ||
| 136 | } | 137 | } |
| 137 | $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route); | 138 | $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route); |
| 138 | $this->curlDelRoute(['new_route'=>$route]); | 139 | $this->curlDelRoute(['new_route'=>$route]); |
| 139 | - return $this->success(); | 140 | + return $this->success(['id'=>$id]); |
| 140 | } | 141 | } |
| 141 | 142 | ||
| 142 | /** | 143 | /** |
| @@ -72,7 +72,7 @@ class ProductLogic extends BaseLogic | @@ -72,7 +72,7 @@ class ProductLogic extends BaseLogic | ||
| 72 | } | 72 | } |
| 73 | $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route); | 73 | $this->addUpdateNotify(RouteMap::SOURCE_PRODUCT,$route); |
| 74 | $this->curlDelRoute(['new_route'=>$route]); | 74 | $this->curlDelRoute(['new_route'=>$route]); |
| 75 | - return $this->success(); | 75 | + return $this->success(['id'=>$id]); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | /** | 78 | /** |
| @@ -495,6 +495,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -495,6 +495,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 495 | Route::any('/save', [\App\Http\Controllers\Bside\CustomModule\CustomModuleCategoryController::class, 'save'])->name('custom_category_save'); | 495 | Route::any('/save', [\App\Http\Controllers\Bside\CustomModule\CustomModuleCategoryController::class, 'save'])->name('custom_category_save'); |
| 496 | Route::any('/del', [\App\Http\Controllers\Bside\CustomModule\CustomModuleCategoryController::class, 'del'])->name('custom_category_del'); | 496 | Route::any('/del', [\App\Http\Controllers\Bside\CustomModule\CustomModuleCategoryController::class, 'del'])->name('custom_category_del'); |
| 497 | Route::any('/sort', [\App\Http\Controllers\Bside\CustomModule\CustomModuleCategoryController::class, 'sort'])->name('custom_category_sort'); | 497 | Route::any('/sort', [\App\Http\Controllers\Bside\CustomModule\CustomModuleCategoryController::class, 'sort'])->name('custom_category_sort'); |
| 498 | + Route::any('/copyCategory', [\App\Http\Controllers\Bside\CustomModule\CustomModuleCategoryController::class, 'copyCategory'])->name('custom_category_copyCategory'); | ||
| 498 | Route::any('/allSort', [\App\Http\Controllers\Bside\CustomModule\CustomModuleCategoryController::class, 'allSort'])->name('custom_category_allSort'); | 499 | Route::any('/allSort', [\App\Http\Controllers\Bside\CustomModule\CustomModuleCategoryController::class, 'allSort'])->name('custom_category_allSort'); |
| 499 | }); | 500 | }); |
| 500 | 501 |
-
请 注册 或 登录 后发表评论