Просмотр исходного кода

feat: NG-15: 新会员注册时增加国家与语言选项.

kevin 1 год назад
Родитель
Сommit
7147579168
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      common/models/Countries.php

+ 3 - 3
common/models/Countries.php

@@ -65,7 +65,7 @@ class Countries extends \common\components\ActiveRecord
         $data = Yii::$app->cache->get(Cache::COUNTRIES_KEY);
         if (!$data) {
             // 获取信息
-            $data = static::find()->orderBy('ACTIVE DESC, NAME ASC')->indexBy('ID')->asArray()->all();
+            $data = self::getAllData();
             Yii::$app->cache->set(Cache::COUNTRIES_KEY, $data);
         }
 
@@ -77,7 +77,7 @@ class Countries extends \common\components\ActiveRecord
      */
     public static function getAllData()
     {
-        return static::find()->where('1=1')->indexBy('ID')->orderBy('ACTIVE DESC, NAME ASC')->asArray()->all();
+        return static::find()->where('1=1')->orderBy('ACTIVE DESC, NAME ASC')->asArray()->all();
     }
 
     /**
@@ -87,7 +87,7 @@ class Countries extends \common\components\ActiveRecord
     public static function updateToCache()
     {
         // 获取配置
-        $data = static::find()->where('1=1')->orderBy('ACTIVE DESC, NAME ASC')->asArray()->indexBy('ID')->all();
+        $data = self::getAllData();
         Yii::$app->cache->set(Cache::COUNTRIES_KEY, $data);
         return $data;
     }