Просмотр исходного кода

feat: EK-856: 管理员增加“Country”属性.

kevinElken 10 месяцев назад
Родитель
Сommit
143ef498e5
1 измененных файлов с 3 добавлено и 5 удалено
  1. 3 5
      backendApi/modules/v1/controllers/SiteController.php

+ 3 - 5
backendApi/modules/v1/controllers/SiteController.php

@@ -8,6 +8,7 @@
 namespace backendApi\modules\v1\controllers;
 
 use backendApi\modules\v1\models\AdminCountry;
+use common\helpers\LoggerTool;
 use common\helpers\snowflake\PageSnowFake;
 use common\helpers\Tool;
 use common\models\CurrencyConversions;
@@ -189,11 +190,6 @@ class SiteController extends BaseController
 
                 $countries = array_filter($countries, fn($country) => in_array($country['ID'], $adminCountry));
                 $countries = array_values($countries);
-//                foreach ($countries as $key => $country) {
-//                    if (!in_array($country['ID'], $adminCountry)) {
-//                        unset($countries[$key]);
-//                    }
-//                }
             }
         }
 
@@ -204,6 +200,8 @@ class SiteController extends BaseController
         $currenciesConversions = CurrencyConversions::getFromCache();
         $currenciesConversions = array_column($currenciesConversions, NULL, 'TO_CURRENCY_ID');
 
+        LoggerTool::info(json_encode($countries));
+
         $countries = array_map(fn($country) => [
             ...$country,
             'LOCAL_CURRENCY_NAME' => $currencies[$country['LOCAL_CURRENCY_ID']]['NAME'] ?? '',