作者 lyh

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

... ... @@ -25,6 +25,7 @@ class ProjectCountryLogic extends BaseLogic
if (empty($lists)){
$lists = [];
}
$lists['country_lists'] = $this->countryListsFormat($lists['country_lists']);
return $this->success($lists);
}
... ... @@ -39,6 +40,8 @@ class ProjectCountryLogic extends BaseLogic
if(!isset($this->param['country_lists']) || empty($this->param['country_lists'])){
$this->param['country_lists'] = '';
}
$this->param['country_lists'] = $this->countryListsFormat($this->param['country_lists']);
$info = $this->model->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$this->param['project_id'] = $this->user['project_id'];
... ... @@ -51,4 +54,15 @@ class ProjectCountryLogic extends BaseLogic
}
return $this->success();
}
protected function countryListsFormat($country_lists)
{
//默认选中主语种
$country_lists = explode(',', $country_lists);
$main_lang_id = $this->project['main_lang_id'] ?? 1;
if (!in_array($main_lang_id, $country_lists)) {
$country_lists[] = $main_lang_id;
}
return implode(',', $country_lists);
}
}
... ...