From 6037a13e7fc6850fc22bb0e54b223d1915dd52e2 Mon Sep 17 00:00:00 2001 From: semenov Date: Thu, 25 Jul 2019 12:12:45 +0300 Subject: [PATCH] fixed --- src/controllers/AdminCurrencyController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/controllers/AdminCurrencyController.php b/src/controllers/AdminCurrencyController.php index 9e3d47b..7057211 100644 --- a/src/controllers/AdminCurrencyController.php +++ b/src/controllers/AdminCurrencyController.php @@ -13,6 +13,7 @@ use skeeks\cms\backend\BackendAction; use skeeks\cms\backend\controllers\BackendModelStandartController; use skeeks\cms\grid\BooleanColumn; +use skeeks\cms\money\Currency; use skeeks\cms\money\models\MoneyCurrency; use skeeks\yii2\form\fields\BoolField; use yii\helpers\ArrayHelper; @@ -119,20 +120,20 @@ public function updateFields() public function actionUpdateAll() { if (\Yii::$app->request->isPost) { - foreach (\skeeks\modules\cms\money\Currency::$currencies as $code => $data) { - $currency = new \skeeks\modules\cms\money\Currency($code); + foreach (Currency::$currencies as $code => $data) { + $currency = new Currency($code);MoneyComponent if (!$currencyModel = MoneyCurrency::find()->where(['code' => $code])->one()) { $currencyModel = new MoneyCurrency([ 'code' => $code, 'is_active' => 0, - 'name' => $currency->getDisplayName(), + 'name' => $currency->name, ]); $currencyModel->save(false); } else { if (!$currencyModel->name) { - $currencyModel->name = $currency->getDisplayName(); + $currencyModel->name = $currency->name; }