作者 刘锟

小语种自定义跳转链接

@@ -34,6 +34,12 @@ class ProjectCountryController extends BaseController @@ -34,6 +34,12 @@ class ProjectCountryController extends BaseController
34 $this->response('success'); 34 $this->response('success');
35 } 35 }
36 36
  37 + /**
  38 + * 自定义语种跳转链接
  39 + * @param DomainInfoLogic $domainInfoLogic
  40 + * @author Akun
  41 + * @date 2024/03/05 9:47
  42 + */
37 public function custom(DomainInfoLogic $domainInfoLogic){ 43 public function custom(DomainInfoLogic $domainInfoLogic){
38 $this->request->validate([ 44 $this->request->validate([
39 'language_id'=>'required', 45 'language_id'=>'required',
@@ -352,6 +352,13 @@ class DomainInfoLogic extends BaseLogic @@ -352,6 +352,13 @@ class DomainInfoLogic extends BaseLogic
352 return false; 352 return false;
353 } 353 }
354 354
  355 + /**
  356 + * 设置语种自定义跳转链接
  357 + * @param $project_id
  358 + * @return array
  359 + * @author Akun
  360 + * @date 2024/03/05 9:48
  361 + */
355 public function country_custom($project_id){ 362 public function country_custom($project_id){
356 $project_model = new Project(); 363 $project_model = new Project();
357 $project_info = $project_model->read(['id'=>$project_id],'serve_id'); 364 $project_info = $project_model->read(['id'=>$project_id],'serve_id');
@@ -62,9 +62,11 @@ class ProjectCountryLogic extends BaseLogic @@ -62,9 +62,11 @@ class ProjectCountryLogic extends BaseLogic
62 $this->fail('当前数据不存在'); 62 $this->fail('当前数据不存在');
63 } 63 }
64 64
65 - //将未勾选的设置了自定义跳转的语种,置为不可用  
66 $custom_model = new CountryCustom(); 65 $custom_model = new CountryCustom();
  66 + //将未勾选的设置了自定义跳转的语种,置为不可用
67 $custom_model->edit(['status'=>0],['project_id'=>$this->user['project_id'],'language_id'=>['not in',explode(',',$this->param['country_lists'])]]); 67 $custom_model->edit(['status'=>0],['project_id'=>$this->user['project_id'],'language_id'=>['not in',explode(',',$this->param['country_lists'])]]);
  68 + //将勾选的设置了自定义跳转的语种,置为可用
  69 + $custom_model->edit(['status'=>1],['project_id'=>$this->user['project_id'],'language_id'=>['in',explode(',',$this->param['country_lists'])]]);
68 70
69 return $this->success(); 71 return $this->success();
70 } 72 }