Merge remote-tracking branch 'origin/master' into akun
正在显示
14 个修改的文件
包含
63 行增加
和
23 行删除
| @@ -460,7 +460,6 @@ if (!function_exists('getImageUrl')) { | @@ -460,7 +460,6 @@ if (!function_exists('getImageUrl')) { | ||
| 460 | foreach ($path as $v){ | 460 | foreach ($path as $v){ |
| 461 | $url[] = getImageUrl($v); | 461 | $url[] = getImageUrl($v); |
| 462 | } | 462 | } |
| 463 | - $url = array_filter($url); | ||
| 464 | }else{ | 463 | }else{ |
| 465 | if(empty($path)){ | 464 | if(empty($path)){ |
| 466 | return ''; | 465 | return ''; |
| @@ -90,13 +90,13 @@ class CustomModuleExtentController extends BaseController | @@ -90,13 +90,13 @@ class CustomModuleExtentController extends BaseController | ||
| 90 | * @method :post | 90 | * @method :post |
| 91 | * @time :2023/12/21 9:25 | 91 | * @time :2023/12/21 9:25 |
| 92 | */ | 92 | */ |
| 93 | - public function extendContent(CustomModuleExtentContent $content){ | 93 | + public function extendContent(CustomModuleExtend $extend){ |
| 94 | $this->request->validate([ | 94 | $this->request->validate([ |
| 95 | 'module_id'=>['required'], | 95 | 'module_id'=>['required'], |
| 96 | ],[ | 96 | ],[ |
| 97 | 'module_id.required' => 'module_id不能为空', | 97 | 'module_id.required' => 'module_id不能为空', |
| 98 | ]); | 98 | ]); |
| 99 | - $lists = $content->list($this->map); | 99 | + $lists = $extend->list($this->map,'created_at'); |
| 100 | $this->response('success',Code::SUCCESS,$lists); | 100 | $this->response('success',Code::SUCCESS,$lists); |
| 101 | } | 101 | } |
| 102 | 102 |
| @@ -215,9 +215,11 @@ class NavController extends BaseController | @@ -215,9 +215,11 @@ class NavController extends BaseController | ||
| 215 | */ | 215 | */ |
| 216 | public function setSortList(NavLogic $navLogic){ | 216 | public function setSortList(NavLogic $navLogic){ |
| 217 | $this->request->validate([ | 217 | $this->request->validate([ |
| 218 | - 'id'=>'required' | 218 | + 'id'=>'required', |
| 219 | + 'sort_list'=>'required', | ||
| 219 | ],[ | 220 | ],[ |
| 220 | 'id.required' => 'ID不能为空', | 221 | 'id.required' => 'ID不能为空', |
| 222 | + 'sort_list.required' => '排序不能为空', | ||
| 221 | ]); | 223 | ]); |
| 222 | $navLogic->setSortList(); | 224 | $navLogic->setSortList(); |
| 223 | $this->response('success'); | 225 | $this->response('success'); |
| @@ -62,7 +62,6 @@ class CategoryController extends BaseController | @@ -62,7 +62,6 @@ class CategoryController extends BaseController | ||
| 62 | if(!empty($this->map['title'])){ | 62 | if(!empty($this->map['title'])){ |
| 63 | $this->map['title'] = ['like','%'.$this->map['title'].'%']; | 63 | $this->map['title'] = ['like','%'.$this->map['title'].'%']; |
| 64 | } | 64 | } |
| 65 | - $this->map['project_id'] = $this->user['project_id']; | ||
| 66 | return $this->map; | 65 | return $this->map; |
| 67 | } | 66 | } |
| 68 | 67 |
| @@ -174,8 +174,6 @@ class ProjectLogic extends BaseLogic | @@ -174,8 +174,6 @@ class ProjectLogic extends BaseLogic | ||
| 174 | } | 174 | } |
| 175 | } | 175 | } |
| 176 | $param['notice_file'] = Arr::a2s($param['notice_file']); | 176 | $param['notice_file'] = Arr::a2s($param['notice_file']); |
| 177 | - }else{ | ||
| 178 | - unset($param['notice_file']); | ||
| 179 | } | 177 | } |
| 180 | if(isset($param['confirm_file']) && !empty($param['confirm_file'])){ | 178 | if(isset($param['confirm_file']) && !empty($param['confirm_file'])){ |
| 181 | foreach ($param['confirm_file'] as &$v2) { | 179 | foreach ($param['confirm_file'] as &$v2) { |
| @@ -184,11 +182,8 @@ class ProjectLogic extends BaseLogic | @@ -184,11 +182,8 @@ class ProjectLogic extends BaseLogic | ||
| 184 | } | 182 | } |
| 185 | } | 183 | } |
| 186 | $param['confirm_file'] = Arr::a2s($param['confirm_file']); | 184 | $param['confirm_file'] = Arr::a2s($param['confirm_file']); |
| 187 | - }else{ | ||
| 188 | - unset($param['confirm_file']); | ||
| 189 | } | 185 | } |
| 190 | unset($param['payment'],$param['deploy_build'],$param['deploy_optimize'],$param['online_check'],$param['project_after']); | 186 | unset($param['payment'],$param['deploy_build'],$param['deploy_optimize'],$param['online_check'],$param['project_after']); |
| 191 | - | ||
| 192 | //文件上传默认值 | 187 | //文件上传默认值 |
| 193 | if($param['is_upload_manage']){ | 188 | if($param['is_upload_manage']){ |
| 194 | $param['upload_config'] = [ | 189 | $param['upload_config'] = [ |
| @@ -382,8 +377,8 @@ class ProjectLogic extends BaseLogic | @@ -382,8 +377,8 @@ class ProjectLogic extends BaseLogic | ||
| 382 | */ | 377 | */ |
| 383 | public function createUser($mobile,$project_id,$lead_name){ | 378 | public function createUser($mobile,$project_id,$lead_name){ |
| 384 | $userModel = new UserModel(); | 379 | $userModel = new UserModel(); |
| 385 | - //查看当前用户是否存在 | ||
| 386 | - $info = $userModel->read(['mobile'=>$mobile,'project_id'=>$project_id]); | 380 | + //查看当前项目是否存在超级管理员 |
| 381 | + $info = $userModel->read(['role_id'=>0,'project_id'=>$project_id]); | ||
| 387 | if($info === false){ | 382 | if($info === false){ |
| 388 | $data = [ | 383 | $data = [ |
| 389 | 'mobile'=>$mobile, | 384 | 'mobile'=>$mobile, |
| @@ -395,6 +390,8 @@ class ProjectLogic extends BaseLogic | @@ -395,6 +390,8 @@ class ProjectLogic extends BaseLogic | ||
| 395 | 'create_id'=>$this->manager['id'] ?? 0, | 390 | 'create_id'=>$this->manager['id'] ?? 0, |
| 396 | ]; | 391 | ]; |
| 397 | $userModel->add($data); | 392 | $userModel->add($data); |
| 393 | + }else{ | ||
| 394 | + $userModel->edit(['mobile'=>$mobile,'name'=>$lead_name],['id'=>$info['id']]); | ||
| 398 | } | 395 | } |
| 399 | return $this->success(); | 396 | return $this->success(); |
| 400 | } | 397 | } |
| @@ -104,7 +104,6 @@ class UserLogic extends BaseLogic | @@ -104,7 +104,6 @@ class UserLogic extends BaseLogic | ||
| 104 | if($param['role_id'] == $this->model::ROLE_MANAGER){ | 104 | if($param['role_id'] == $this->model::ROLE_MANAGER){ |
| 105 | if(isset($param['id']) && !empty($param['id'])){ | 105 | if(isset($param['id']) && !empty($param['id'])){ |
| 106 | $condition = [ | 106 | $condition = [ |
| 107 | - 'mobile' => $param['mobile'], | ||
| 108 | 'project_id'=>$param['project_id'], | 107 | 'project_id'=>$param['project_id'], |
| 109 | 'id' => ['!=', $param['id']], | 108 | 'id' => ['!=', $param['id']], |
| 110 | 'role_id'=>$this->model::ROLE_MANAGER | 109 | 'role_id'=>$this->model::ROLE_MANAGER |
| @@ -157,7 +156,11 @@ class UserLogic extends BaseLogic | @@ -157,7 +156,11 @@ class UserLogic extends BaseLogic | ||
| 157 | } | 156 | } |
| 158 | Common::del_user_cache($this->model, $id, 'A'); | 157 | Common::del_user_cache($this->model, $id, 'A'); |
| 159 | }else{ | 158 | }else{ |
| 160 | - $this->fail('超级管理员不允许删除'); | 159 | + //查看当前项目是否有其他的超级管理员 |
| 160 | + $roleInfo = $this->model->read(['id'=>['!=',$info['id']],'role_id'=>0]); | ||
| 161 | + if($roleInfo === false){ | ||
| 162 | + $this->fail('超级管理员不允许删除'); | ||
| 163 | + } | ||
| 161 | } | 164 | } |
| 162 | } | 165 | } |
| 163 | return $this->success(); | 166 | return $this->success(); |
| @@ -94,6 +94,9 @@ class CustomTemplateLogic extends BaseLogic | @@ -94,6 +94,9 @@ class CustomTemplateLogic extends BaseLogic | ||
| 94 | public function saveHtml(){ | 94 | public function saveHtml(){ |
| 95 | $html = $this->param['html']; | 95 | $html = $this->param['html']; |
| 96 | $info = $this->model->read(['id'=>$this->param['id']],['id','is_visualization','url']); | 96 | $info = $this->model->read(['id'=>$this->param['id']],['id','is_visualization','url']); |
| 97 | + if($info === false){ | ||
| 98 | + $this->fail('当前数据不存在或已被删除'); | ||
| 99 | + } | ||
| 97 | if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){//非定制项目+可视化页面 | 100 | if($info['is_visualization'] == 0 || $info['is_visualization'] == 1){//非定制项目+可视化页面 |
| 98 | //获取设置的默认模版 | 101 | //获取设置的默认模版 |
| 99 | $bSettingModel = new Setting(); | 102 | $bSettingModel = new Setting(); |
| @@ -281,6 +281,7 @@ class CustomModuleContentLogic extends BaseLogic | @@ -281,6 +281,7 @@ class CustomModuleContentLogic extends BaseLogic | ||
| 281 | } | 281 | } |
| 282 | $v['project_id'] = $this->user['project_id']; | 282 | $v['project_id'] = $this->user['project_id']; |
| 283 | $v['content_id'] = $content_id; | 283 | $v['content_id'] = $content_id; |
| 284 | + $v['module_id'] = $content_id; | ||
| 284 | return $this->success($v); | 285 | return $this->success($v); |
| 285 | } | 286 | } |
| 286 | 287 |
| @@ -265,8 +265,4 @@ class NavLogic extends BaseLogic | @@ -265,8 +265,4 @@ class NavLogic extends BaseLogic | ||
| 265 | $navGroupModel->edit(['sort_list'=>$this->param['sort_list']],['id'=>$this->param['id']]); | 265 | $navGroupModel->edit(['sort_list'=>$this->param['sort_list']],['id'=>$this->param['id']]); |
| 266 | return $this->success(); | 266 | return $this->success(); |
| 267 | } | 267 | } |
| 268 | - | ||
| 269 | - | ||
| 270 | - | ||
| 271 | - | ||
| 272 | } | 268 | } |
| @@ -99,6 +99,7 @@ class CategoryLogic extends BaseLogic | @@ -99,6 +99,7 @@ class CategoryLogic extends BaseLogic | ||
| 99 | $info = $this->model->read(['id'=>$id]); | 99 | $info = $this->model->read(['id'=>$id]); |
| 100 | $info['url'] = $info['route']; | 100 | $info['url'] = $info['route']; |
| 101 | $info['image_link'] = getImageUrl($info['image']); | 101 | $info['image_link'] = getImageUrl($info['image']); |
| 102 | + $info['describe_image'] = !empty($info['describe_image']) ? getImageUrl(json_decode($info['describe_image'])) : []; | ||
| 102 | return $this->success($info); | 103 | return $this->success($info); |
| 103 | } | 104 | } |
| 104 | 105 | ||
| @@ -112,6 +113,7 @@ class CategoryLogic extends BaseLogic | @@ -112,6 +113,7 @@ class CategoryLogic extends BaseLogic | ||
| 112 | public function categorySave(){ | 113 | public function categorySave(){ |
| 113 | DB::beginTransaction(); | 114 | DB::beginTransaction(); |
| 114 | try { | 115 | try { |
| 116 | + $this->param = $this->saveHandleParam($this->param); | ||
| 115 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 117 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 116 | $this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $this->param['id'], $this->user['project_id']); | 118 | $this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $this->param['id'], $this->user['project_id']); |
| 117 | $route = $this->param['route']; | 119 | $route = $this->param['route']; |
| @@ -135,6 +137,24 @@ class CategoryLogic extends BaseLogic | @@ -135,6 +137,24 @@ class CategoryLogic extends BaseLogic | ||
| 135 | } | 137 | } |
| 136 | 138 | ||
| 137 | /** | 139 | /** |
| 140 | + * @remark :保存时处理数据 | ||
| 141 | + * @name :saveHandleParam | ||
| 142 | + * @author :lyh | ||
| 143 | + * @method :post | ||
| 144 | + * @time :2023/12/22 17:28 | ||
| 145 | + */ | ||
| 146 | + public function saveHandleParam($param){ | ||
| 147 | + if(isset($this->param['describe_image']) && !empty($this->param['describe_image'])){ | ||
| 148 | + foreach ($this->param['describe_image'] as $k => $v){ | ||
| 149 | + $v = str_replace_url($v); | ||
| 150 | + $this->param['describe_image'][$k] = $v; | ||
| 151 | + } | ||
| 152 | + $this->param['describe_image'] = json_encode($this->param['describe_image']); | ||
| 153 | + } | ||
| 154 | + return $this->success($param); | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + /** | ||
| 138 | * @remark :删除 | 158 | * @remark :删除 |
| 139 | * @name :delete | 159 | * @name :delete |
| 140 | * @author :lyh | 160 | * @author :lyh |
| @@ -69,6 +69,21 @@ class ProductLogic extends BaseLogic | @@ -69,6 +69,21 @@ class ProductLogic extends BaseLogic | ||
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | /** | 71 | /** |
| 72 | + * @remark :设置最新产品的sort排序 | ||
| 73 | + * @name :setNewsSort | ||
| 74 | + * @author :lyh | ||
| 75 | + * @method :post | ||
| 76 | + * @time :2023/12/25 9:27 | ||
| 77 | + */ | ||
| 78 | + public function setNewsSort(){ | ||
| 79 | + $info = $this->model->orderBy('sort','desc')->first(); | ||
| 80 | + if($info === false){ | ||
| 81 | + return 1; | ||
| 82 | + } | ||
| 83 | + return $info['sort']++; | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + /** | ||
| 72 | * @remark :处理扩展字段 | 87 | * @remark :处理扩展字段 |
| 73 | * @name :handleExtent | 88 | * @name :handleExtent |
| 74 | * @author :lyh | 89 | * @author :lyh |
| @@ -25,6 +25,7 @@ class BlogRequest extends FormRequest | @@ -25,6 +25,7 @@ class BlogRequest extends FormRequest | ||
| 25 | { | 25 | { |
| 26 | return [ | 26 | return [ |
| 27 | 'name'=>'required|max:100', | 27 | 'name'=>'required|max:100', |
| 28 | + 'remark'=>'max:255', | ||
| 28 | 'url'=>'required', | 29 | 'url'=>'required', |
| 29 | ]; | 30 | ]; |
| 30 | } | 31 | } |
| @@ -33,7 +34,9 @@ class BlogRequest extends FormRequest | @@ -33,7 +34,9 @@ class BlogRequest extends FormRequest | ||
| 33 | { | 34 | { |
| 34 | return [ | 35 | return [ |
| 35 | 'name.required'=>'请填写名称', | 36 | 'name.required'=>'请填写名称', |
| 36 | - 'url.required'=>'链接不能为空' | 37 | + 'name.max'=>'名称超过最长长度', |
| 38 | + 'url.required'=>'链接不能为空', | ||
| 39 | + 'remark.max'=>'描述超过最长长度' | ||
| 37 | ]; | 40 | ]; |
| 38 | } | 41 | } |
| 39 | } | 42 | } |
| @@ -24,7 +24,8 @@ class NewsRequest extends FormRequest | @@ -24,7 +24,8 @@ class NewsRequest extends FormRequest | ||
| 24 | public function rules() | 24 | public function rules() |
| 25 | { | 25 | { |
| 26 | return [ | 26 | return [ |
| 27 | - 'name'=>'required|max:200', | 27 | + 'name'=>'required|max:100', |
| 28 | + 'remark'=>'max:255', | ||
| 28 | 'url'=>'required', | 29 | 'url'=>'required', |
| 29 | ]; | 30 | ]; |
| 30 | } | 31 | } |
| @@ -33,8 +34,9 @@ class NewsRequest extends FormRequest | @@ -33,8 +34,9 @@ class NewsRequest extends FormRequest | ||
| 33 | { | 34 | { |
| 34 | return [ | 35 | return [ |
| 35 | 'name.required'=>'请填写名称', | 36 | 'name.required'=>'请填写名称', |
| 36 | - 'name.max'=>'名称最大200字', | ||
| 37 | - 'url.required'=>'新闻链接不能为空' | 37 | + 'name.max'=>'名称超过最长长度', |
| 38 | + 'url.required'=>'链接不能为空', | ||
| 39 | + 'remark.max'=>'描述超过最长长度' | ||
| 38 | ]; | 40 | ]; |
| 39 | } | 41 | } |
| 40 | } | 42 | } |
| @@ -355,7 +355,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -355,7 +355,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 355 | Route::any('/read', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'read'])->name('custom_read'); | 355 | Route::any('/read', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'read'])->name('custom_read'); |
| 356 | Route::any('/save', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'save'])->name('custom_save'); | 356 | Route::any('/save', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'save'])->name('custom_save'); |
| 357 | Route::any('/saveHtml', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'saveHtml'])->name('custom_saveHtml'); | 357 | Route::any('/saveHtml', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'saveHtml'])->name('custom_saveHtml'); |
| 358 | - Route::any('/statusNum', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'statusNumber'])->name('product_statusNum'); | 358 | + Route::any('/statusNum', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'statusNumber'])->name('custom_statusNum'); |
| 359 | Route::any('/del', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'del'])->name('custom_del'); | 359 | Route::any('/del', [\App\Http\Controllers\Bside\Template\CustomTemplateController::class, 'del'])->name('custom_del'); |
| 360 | }); | 360 | }); |
| 361 | // 菜单组 | 361 | // 菜单组 |
-
请 注册 或 登录 后发表评论