作者 刘锟

小语种自定义跳转链接

... ... @@ -35,22 +35,40 @@ class ProjectCountryController extends BaseController
}
/**
* 自定义语种跳转链接
* 设置语种自定义跳转链接
* @param DomainInfoLogic $domainInfoLogic
* @author Akun
* @date 2024/03/05 9:47
*/
public function custom(DomainInfoLogic $domainInfoLogic){
public function custom_save(DomainInfoLogic $domainInfoLogic){
$this->request->validate([
'language_id'=>'required',
'custom_domain'=>'required',
'is_create'=>'required',
'is_create'=>'required'
],[
'language_id.required' => 'language_id不能为空',
'custom_domain.required' => 'custom_domain不能为空',
'is_create.required' => 'is_create不能为空',
'is_create.required' => 'is_create不能为空'
]);
$domainInfoLogic->country_custom($this->user['project_id']);
$this->response('success');
}
/**
* 清除语种自定义跳转链接
* @param ProjectCountryLogic $projectCountryLogic
* @author Akun
* @date 2024/03/05 10:20
*/
public function custom_del(ProjectCountryLogic $projectCountryLogic){
$this->request->validate([
'language_id'=>'required'
],[
'language_id.required' => 'language_id不能为空'
]);
$projectCountryLogic->country_custom_del();
$this->response('success');
}
}
... ...
... ... @@ -74,6 +74,22 @@ class ProjectCountryLogic extends BaseLogic
return $this->success();
}
/**
* 删除语种自定义跳转
* @return array
* @author Akun
* @date 2024/03/05 10:18
*/
public function country_custom_del(){
$custom_model = new CountryCustom();
$rs = $custom_model->del(['project_id'=>$this->user['project_id'],'language_id'=>$this->param['language_id']]);
if($rs === false){
$this->fail('error');
}
return $this->success();
}
protected function countryListsFormat($country_lists)
{
if(empty($country_lists)){
... ...
... ... @@ -156,7 +156,8 @@ Route::middleware(['bloginauth'])->group(function () {
Route::prefix('country')->group(function () {
Route::any('/info', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'info'])->name('web_setting_country_info');
Route::any('/save', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'save'])->name('web_setting_country_save');
Route::any('/custom', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'custom'])->name('web_setting_country_custom');
Route::any('/custom_save', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'custom_save'])->name('web_setting_country_custom_save');
Route::any('/custom_del', [\App\Http\Controllers\Bside\Setting\ProjectCountryController::class, 'custom_del'])->name('web_setting_country_custom_del');
});
//客服设置
Route::prefix('service')->group(function () {
... ...