正在显示
1 个修改的文件
包含
4 行增加
和
1 行删除
| @@ -40,7 +40,6 @@ class ProjectCountryLogic extends BaseLogic | @@ -40,7 +40,6 @@ class ProjectCountryLogic extends BaseLogic | ||
| 40 | if(!isset($this->param['country_lists']) || empty($this->param['country_lists'])){ | 40 | if(!isset($this->param['country_lists']) || empty($this->param['country_lists'])){ |
| 41 | $this->param['country_lists'] = ''; | 41 | $this->param['country_lists'] = ''; |
| 42 | } | 42 | } |
| 43 | - | ||
| 44 | $this->param['country_lists'] = $this->countryListsFormat($this->param['country_lists']); | 43 | $this->param['country_lists'] = $this->countryListsFormat($this->param['country_lists']); |
| 45 | $info = $this->model->read(['project_id'=>$this->user['project_id']]); | 44 | $info = $this->model->read(['project_id'=>$this->user['project_id']]); |
| 46 | if($info === false){ | 45 | if($info === false){ |
| @@ -57,8 +56,12 @@ class ProjectCountryLogic extends BaseLogic | @@ -57,8 +56,12 @@ class ProjectCountryLogic extends BaseLogic | ||
| 57 | 56 | ||
| 58 | protected function countryListsFormat($country_lists) | 57 | protected function countryListsFormat($country_lists) |
| 59 | { | 58 | { |
| 59 | + if(empty($country_lists)){ | ||
| 60 | + $country_lists = []; | ||
| 61 | + }else{ | ||
| 60 | //默认选中主语种 | 62 | //默认选中主语种 |
| 61 | $country_lists = explode(',', $country_lists); | 63 | $country_lists = explode(',', $country_lists); |
| 64 | + } | ||
| 62 | $main_lang_id = $this->project['main_lang_id'] ?? 1; | 65 | $main_lang_id = $this->project['main_lang_id'] ?? 1; |
| 63 | if (!in_array($main_lang_id, $country_lists)) { | 66 | if (!in_array($main_lang_id, $country_lists)) { |
| 64 | $country_lists[] = $main_lang_id; | 67 | $country_lists[] = $main_lang_id; |
-
请 注册 或 登录 后发表评论