作者 刘锟

小语种排序

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