|
|
@@ -1196,11 +1196,17 @@ class UserController extends BaseController
|
|
|
->asArray()
|
|
|
->all();
|
|
|
|
|
|
- $adminId = Yii::$app->getUser()->getUserInfo()['id'];
|
|
|
- $adminCountry = AdminCountry::getCountry($adminId);
|
|
|
-
|
|
|
$countries = Countries::getFromCache();
|
|
|
- $countries = array_filter($countries, fn($country) => in_array($country['ID'], $adminCountry));
|
|
|
+
|
|
|
+ $isSuper = AdminRole::isSuperAdmin(\Yii::$app->getUser()->getUserInfo()['roleId']);
|
|
|
+ if (!$isSuper) {
|
|
|
+ $adminId = Yii::$app->getUser()->getUserInfo()['id'];
|
|
|
+ $adminCountry = AdminCountry::getCountry($adminId);
|
|
|
+
|
|
|
+ $countries = array_filter($countries, fn($country) => in_array($country['ID'], $adminCountry));
|
|
|
+ $countries = array_values($countries);
|
|
|
+ }
|
|
|
+
|
|
|
$data['country'] = array_values($countries);
|
|
|
|
|
|
$data['userInfo'] = [
|