Przeglądaj źródła

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

kevin 1 rok temu
rodzic
commit
78e19c0524

+ 1 - 1
backendApi/modules/v1/controllers/TransportationController.php

@@ -32,7 +32,7 @@ class TransportationController extends BaseController
         foreach ($countries as &$country) {
             $country['freight'] = $transportation[$country['ID']]['freight'] ?? 0;
             $country['free_shipping'] = $transportation[$country['ID']]['free_shipping'] ?? 0;
-            $country['currency_id'] = $transportation[$country['ID']]['currency_id'] ?? 0;
+            $country['currency'] = $this->countiesModelClass->getCurrency($country['ID']['LOCAL_CURRENCY_ID']);
         }
 
         return static::notice(['data' => $countries]);

+ 0 - 9
common/models/Countries.php

@@ -113,13 +113,4 @@ class Countries extends \common\components\ActiveRecord
         $record = self::findOneAsArray('ID=:ID', [':ID' => $id]);
         return $record['LOCAL_CURRENCY_ID'] ?? 0;
     }
-
-    /**
-     * 关联currency.
-     * @return \yii\db\ActiveQuery
-     */
-//    public function currency()
-//    {
-//        return $this->hasOne(Currency::className(), ['ID' => 'LOCAL_CURRENCY_ID']);
-//    }
 }