|
|
@@ -7,6 +7,7 @@
|
|
|
*/
|
|
|
namespace backendApi\modules\v1\controllers;
|
|
|
|
|
|
+use backendApi\modules\v1\models\AdminCountry;
|
|
|
use common\helpers\snowflake\PageSnowFake;
|
|
|
use common\helpers\Tool;
|
|
|
use common\models\CurrencyConversions;
|
|
|
@@ -179,6 +180,17 @@ class SiteController extends BaseController
|
|
|
{
|
|
|
// 国家
|
|
|
$countries = Cache::getCountries();
|
|
|
+
|
|
|
+ if (\Yii::$app->request->hasProperty('filter')) {
|
|
|
+ $filter = \Yii::$app->request->get('filter');
|
|
|
+ if ($filter) {
|
|
|
+ $adminId = Yii::$app->getUser()->getUserInfo()['id'];
|
|
|
+ $adminCountry = AdminCountry::getCountry($adminId);
|
|
|
+
|
|
|
+ $countries = array_filter($countries, fn($country) => in_array($country['ID'], $adminCountry));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 货币
|
|
|
$currencies = Cache::getCurrencies();
|
|
|
$currencies = array_column($currencies, NULL, 'ID');
|