Quellcode durchsuchen

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

kevin vor 1 Jahr
Ursprung
Commit
b5f7195c0d
1 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen
  1. 5 5
      common/models/FreeTemplate.php

+ 5 - 5
common/models/FreeTemplate.php

@@ -13,8 +13,8 @@ use Yii;
  * @property double freight 运费
  * @property double free_shipping 免运费阈值
  * @property int currency_id 币种ID
- * @property int created_at 订单创建时间
- * @property int updated_at 订单创建人
+ * @property int created_at 创建时间
+ * @property int updated_at 更新时间
  */
 class FreeTemplate extends \common\components\ActiveRecord
 {
@@ -44,7 +44,7 @@ class FreeTemplate extends \common\components\ActiveRecord
     public function attributeLabels()
     {
         return [
-            'id' => 'ID',
+            'id' => 'id',
             'country_id' => '国家ID',
             'freight' => '运费',
             'free_shipping' => '免运费阈值',
@@ -73,7 +73,7 @@ class FreeTemplate extends \common\components\ActiveRecord
         $data = Yii::$app->cache->get(Cache::FREE_TEMPLATE_KEY);
         if (!$data) {
             // 获取信息
-            $data = static::find()->orderBy('id ASC')->indexBy('id')->asArray()->all();
+            $data = self::getAllData();
             Yii::$app->cache->set(Cache::FREE_TEMPLATE_KEY, $data);
         }
 
@@ -95,7 +95,7 @@ class FreeTemplate extends \common\components\ActiveRecord
     public static function updateToCache()
     {
         // 获取配置
-        $data = static::find()->orderBy('id ASC')->asArray()->indexBy('id')->all();
+        $data = self::getAllData();
         Yii::$app->cache->set(Cache::FREE_TEMPLATE_KEY, $data);
         return $data;
     }