正在显示
4 个修改的文件
包含
32 行增加
和
2 行删除
| @@ -32,7 +32,7 @@ class CustomModuleContentController extends BaseController | @@ -32,7 +32,7 @@ class CustomModuleContentController extends BaseController | ||
| 32 | 'module_id.required' => 'module_id不能为空', | 32 | 'module_id.required' => 'module_id不能为空', |
| 33 | ]); | 33 | ]); |
| 34 | $this->map['project_id'] = $this->user['project_id']; | 34 | $this->map['project_id'] = $this->user['project_id']; |
| 35 | - $lists = $customModuleContent->lists($this->map,$this->page,$this->row,$this->order); | 35 | + $lists = $customModuleContent->lists($this->map,$this->page,$this->row,$this->order = ['sort','id']); |
| 36 | if(!empty($lists)){ | 36 | if(!empty($lists)){ |
| 37 | $data = $this->getAllCategoryName(); | 37 | $data = $this->getAllCategoryName(); |
| 38 | foreach ($lists['list'] as $k=>$v){ | 38 | foreach ($lists['list'] as $k=>$v){ |
| @@ -158,4 +158,21 @@ class CustomModuleContentController extends BaseController | @@ -158,4 +158,21 @@ class CustomModuleContentController extends BaseController | ||
| 158 | $logic->contentDel(); | 158 | $logic->contentDel(); |
| 159 | $this->response('success'); | 159 | $this->response('success'); |
| 160 | } | 160 | } |
| 161 | + | ||
| 162 | + /** | ||
| 163 | + * @remark :排序 | ||
| 164 | + * @name :sort | ||
| 165 | + * @author :lyh | ||
| 166 | + * @method :post | ||
| 167 | + * @time :2023/12/15 17:46 | ||
| 168 | + */ | ||
| 169 | + public function sort(CustomModuleContentLogic $logic){ | ||
| 170 | + $this->request->validate([ | ||
| 171 | + 'id'=>['required'], | ||
| 172 | + ],[ | ||
| 173 | + 'id.required' => 'ID不能为空', | ||
| 174 | + ]); | ||
| 175 | + $logic->contentSort(); | ||
| 176 | + $this->response('success'); | ||
| 177 | + } | ||
| 161 | } | 178 | } |
| @@ -83,13 +83,13 @@ class BTemplateLogic extends BaseLogic | @@ -83,13 +83,13 @@ class BTemplateLogic extends BaseLogic | ||
| 83 | } | 83 | } |
| 84 | $mainInfo = $this->getCommonMain($source,$source_id,$is_custom);//获取中间部分代码 | 84 | $mainInfo = $this->getCommonMain($source,$source_id,$is_custom);//获取中间部分代码 |
| 85 | }else{ | 85 | }else{ |
| 86 | - $mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']]; | ||
| 87 | if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码 | 86 | if($templateInfo['type'] == BTemplate::ALL_HTML){//返回整个html代码 |
| 88 | $type = $this->getCustomizedType($source, $source_id);//定制获取头部底部类型 | 87 | $type = $this->getCustomizedType($source, $source_id);//定制获取头部底部类型 |
| 89 | $commonInfo = $this->getCommonPage(0,$this->user['project_id'],$type);//获取定制头部 | 88 | $commonInfo = $this->getCommonPage(0,$this->user['project_id'],$type);//获取定制头部 |
| 90 | $html = $this->handleAllHtml($commonInfo,$templateInfo['html']); | 89 | $html = $this->handleAllHtml($commonInfo,$templateInfo['html']); |
| 91 | return $this->success(['html'=>$html,'template_id'=>$template_id]); | 90 | return $this->success(['html'=>$html,'template_id'=>$template_id]); |
| 92 | } | 91 | } |
| 92 | + $mainInfo = ['main_html'=>$templateInfo['main_html'], 'main_css'=>$templateInfo['main_css']]; | ||
| 93 | } | 93 | } |
| 94 | $commonInfo = $this->getCommonPage($source,$source_id,$template_id);//获取头部 | 94 | $commonInfo = $this->getCommonPage($source,$source_id,$template_id);//获取头部 |
| 95 | $html = $commonInfo['head_css'].$mainInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. | 95 | $html = $commonInfo['head_css'].$mainInfo['main_css'].$commonInfo['footer_css'].$commonInfo['other']. |
| @@ -325,4 +325,16 @@ class CustomModuleContentLogic extends BaseLogic | @@ -325,4 +325,16 @@ class CustomModuleContentLogic extends BaseLogic | ||
| 325 | $this->curlDelRoute(['route'=>$info['route']]); | 325 | $this->curlDelRoute(['route'=>$info['route']]); |
| 326 | return $this->success(); | 326 | return $this->success(); |
| 327 | } | 327 | } |
| 328 | + | ||
| 329 | + /** | ||
| 330 | + * @remark :排序 | ||
| 331 | + * @name :contentSort | ||
| 332 | + * @author :lyh | ||
| 333 | + * @method :post | ||
| 334 | + * @time :2023/12/15 17:47 | ||
| 335 | + */ | ||
| 336 | + public function contentSort(){ | ||
| 337 | + $this->model->edit(['sort' => $this->param['sort']], ['id'=>$this->param['id']]); | ||
| 338 | + return $this->success(); | ||
| 339 | + } | ||
| 328 | } | 340 | } |
| @@ -445,6 +445,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -445,6 +445,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 445 | Route::any('/getCategoryList', [\App\Http\Controllers\Bside\CustomModule\CustomModuleContentController::class, 'getCategoryList'])->name('custom_content_getCategoryList'); | 445 | Route::any('/getCategoryList', [\App\Http\Controllers\Bside\CustomModule\CustomModuleContentController::class, 'getCategoryList'])->name('custom_content_getCategoryList'); |
| 446 | Route::any('/info', [\App\Http\Controllers\Bside\CustomModule\CustomModuleContentController::class, 'info'])->name('custom_content_info'); | 446 | Route::any('/info', [\App\Http\Controllers\Bside\CustomModule\CustomModuleContentController::class, 'info'])->name('custom_content_info'); |
| 447 | Route::any('/save', [\App\Http\Controllers\Bside\CustomModule\CustomModuleContentController::class, 'save'])->name('custom_content_save'); | 447 | Route::any('/save', [\App\Http\Controllers\Bside\CustomModule\CustomModuleContentController::class, 'save'])->name('custom_content_save'); |
| 448 | + Route::any('/sort', [\App\Http\Controllers\Bside\CustomModule\CustomModuleContentController::class, 'sort'])->name('custom_content_sort'); | ||
| 448 | Route::any('/del', [\App\Http\Controllers\Bside\CustomModule\CustomModuleContentController::class, 'del'])->name('custom_content_del'); | 449 | Route::any('/del', [\App\Http\Controllers\Bside\CustomModule\CustomModuleContentController::class, 'del'])->name('custom_content_del'); |
| 449 | }); | 450 | }); |
| 450 | 451 |
-
请 注册 或 登录 后发表评论