作者 刘锟

小语种排序

... ... @@ -50,7 +50,7 @@ class MinorLanguagesController extends BaseController
*/
public function getLanguages(){
$webLanguageModel = new WebLanguage();
$lists = $webLanguageModel->list($this->map,'id',['short','chinese']);
$lists = $webLanguageModel->list($this->map,'id',['short','chinese'],'asc');
$this->response('success',Code::SUCCESS,$lists);
}
}
... ...
... ... @@ -4,6 +4,7 @@ namespace App\Http\Logic\Bside\Setting;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Project\Country as CountryModel;
use App\Models\WebSetting\WebLanguage;
class ProjectCountryLogic extends BaseLogic
{
... ... @@ -41,6 +42,11 @@ class ProjectCountryLogic extends BaseLogic
$this->param['country_lists'] = '';
}
$this->param['country_lists'] = $this->countryListsFormat($this->param['country_lists']);
if(!isset($this->param['country_sort']) || empty($this->param['country_sort'])){
$webLanguageModel = new WebLanguage();
$all_language_ids = array_column($webLanguageModel->list([],'id',['id'],'asc'),'id');
$this->param['country_sort'] = implode(',',$all_language_ids);
}
$info = $this->model->read(['project_id'=>$this->user['project_id']]);
if($info === false){
$this->param['project_id'] = $this->user['project_id'];
... ...