正在显示
3 个修改的文件
包含
40 行增加
和
5 行删除
| @@ -35,22 +35,40 @@ class ProjectCountryController extends BaseController | @@ -35,22 +35,40 @@ class ProjectCountryController extends BaseController | ||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | - * 自定义语种跳转链接 | 38 | + * 设置语种自定义跳转链接 |
| 39 | * @param DomainInfoLogic $domainInfoLogic | 39 | * @param DomainInfoLogic $domainInfoLogic |
| 40 | * @author Akun | 40 | * @author Akun |
| 41 | * @date 2024/03/05 9:47 | 41 | * @date 2024/03/05 9:47 |
| 42 | */ | 42 | */ |
| 43 | - public function custom(DomainInfoLogic $domainInfoLogic){ | 43 | + public function custom_save(DomainInfoLogic $domainInfoLogic){ |
| 44 | $this->request->validate([ | 44 | $this->request->validate([ |
| 45 | 'language_id'=>'required', | 45 | 'language_id'=>'required', |
| 46 | 'custom_domain'=>'required', | 46 | 'custom_domain'=>'required', |
| 47 | - 'is_create'=>'required', | 47 | + 'is_create'=>'required' |
| 48 | ],[ | 48 | ],[ |
| 49 | 'language_id.required' => 'language_id不能为空', | 49 | 'language_id.required' => 'language_id不能为空', |
| 50 | 'custom_domain.required' => 'custom_domain不能为空', | 50 | 'custom_domain.required' => 'custom_domain不能为空', |
| 51 | - 'is_create.required' => 'is_create不能为空', | 51 | + 'is_create.required' => 'is_create不能为空' |
| 52 | ]); | 52 | ]); |
| 53 | $domainInfoLogic->country_custom($this->user['project_id']); | 53 | $domainInfoLogic->country_custom($this->user['project_id']); |
| 54 | $this->response('success'); | 54 | $this->response('success'); |
| 55 | } | 55 | } |
| 56 | + | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * 清除语种自定义跳转链接 | ||
| 60 | + * @param ProjectCountryLogic $projectCountryLogic | ||
| 61 | + * @author Akun | ||
| 62 | + * @date 2024/03/05 10:20 | ||
| 63 | + */ | ||
| 64 | + public function custom_del(ProjectCountryLogic $projectCountryLogic){ | ||
| 65 | + $this->request->validate([ | ||
| 66 | + 'language_id'=>'required' | ||
| 67 | + ],[ | ||
| 68 | + 'language_id.required' => 'language_id不能为空' | ||
| 69 | + ]); | ||
| 70 | + | ||
| 71 | + $projectCountryLogic->country_custom_del(); | ||
| 72 | + $this->response('success'); | ||
| 73 | + } | ||
| 56 | } | 74 | } |
| @@ -74,6 +74,22 @@ class ProjectCountryLogic extends BaseLogic | @@ -74,6 +74,22 @@ class ProjectCountryLogic extends BaseLogic | ||
| 74 | return $this->success(); | 74 | return $this->success(); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | + /** | ||
| 78 | + * 删除语种自定义跳转 | ||
| 79 | + * @return array | ||
| 80 | + * @author Akun | ||
| 81 | + * @date 2024/03/05 10:18 | ||
| 82 | + */ | ||
| 83 | + public function country_custom_del(){ | ||
| 84 | + $custom_model = new CountryCustom(); | ||
| 85 | + $rs = $custom_model->del(['project_id'=>$this->user['project_id'],'language_id'=>$this->param['language_id']]); | ||
| 86 | + if($rs === false){ | ||
| 87 | + $this->fail('error'); | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + return $this->success(); | ||
| 91 | + } | ||
| 92 | + | ||
| 77 | protected function countryListsFormat($country_lists) | 93 | protected function countryListsFormat($country_lists) |
| 78 | { | 94 | { |
| 79 | if(empty($country_lists)){ | 95 | if(empty($country_lists)){ |
| @@ -156,7 +156,8 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -156,7 +156,8 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 156 | Route::prefix('country')->group(function () { | 156 | Route::prefix('country')->group(function () { |
| 157 | Route::any('/info', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'info'])->name('web_setting_country_info'); | 157 | Route::any('/info', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'info'])->name('web_setting_country_info'); |
| 158 | Route::any('/save', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'save'])->name('web_setting_country_save'); | 158 | Route::any('/save', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'save'])->name('web_setting_country_save'); |
| 159 | - Route::any('/custom', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'custom'])->name('web_setting_country_custom'); | 159 | + Route::any('/custom_save', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'custom_save'])->name('web_setting_country_custom_save'); |
| 160 | + Route::any('/custom_del', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'custom_del'])->name('web_setting_country_custom_del'); | ||
| 160 | }); | 161 | }); |
| 161 | //客服设置 | 162 | //客服设置 |
| 162 | Route::prefix('service')->group(function () { | 163 | Route::prefix('service')->group(function () { |
-
请 注册 或 登录 后发表评论