作者 刘锟

小语种自定义跳转链接

... ... @@ -34,6 +34,12 @@ class ProjectCountryController extends BaseController
$this->response('success');
}
/**
* 自定义语种跳转链接
* @param DomainInfoLogic $domainInfoLogic
* @author Akun
* @date 2024/03/05 9:47
*/
public function custom(DomainInfoLogic $domainInfoLogic){
$this->request->validate([
'language_id'=>'required',
... ...
... ... @@ -352,6 +352,13 @@ class DomainInfoLogic extends BaseLogic
return false;
}
/**
* 设置语种自定义跳转链接
* @param $project_id
* @return array
* @author Akun
* @date 2024/03/05 9:48
*/
public function country_custom($project_id){
$project_model = new Project();
$project_info = $project_model->read(['id'=>$project_id],'serve_id');
... ...
... ... @@ -62,9 +62,11 @@ class ProjectCountryLogic extends BaseLogic
$this->fail('当前数据不存在');
}
//将未勾选的设置了自定义跳转的语种,置为不可用
$custom_model = new CountryCustom();
//将未勾选的设置了自定义跳转的语种,置为不可用
$custom_model->edit(['status'=>0],['project_id'=>$this->user['project_id'],'language_id'=>['not in',explode(',',$this->param['country_lists'])]]);
//将勾选的设置了自定义跳转的语种,置为可用
$custom_model->edit(['status'=>1],['project_id'=>$this->user['project_id'],'language_id'=>['in',explode(',',$this->param['country_lists'])]]);
return $this->success();
}
... ...