|
|
@@ -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;
|
|
|
}
|