Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Jul 25, 2019
1 parent 8915e30 commit 6037a13
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/controllers/AdminCurrencyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}


Expand Down

0 comments on commit 6037a13

Please sign in to comment.