|
@@ -24,7 +24,7 @@ class EnterpriseApi {
|
|
|
$company_info = CompanyApi::getOne($companyId);
|
|
|
$where = [];
|
|
|
$whereRaw = "";
|
|
|
- if ($company_info['code'] != 'super') {
|
|
|
+ if ($company_info['code'] != 'super' && !self::chkUserInSuperusers()) {
|
|
|
$where[] = ['type', '=', session('user')['type']];
|
|
|
if (session('user')['type'] == 1) {
|
|
|
$whr[] = ["companyId", "=", $companyId];
|
|
@@ -198,7 +198,7 @@ class EnterpriseApi {
|
|
|
$company_info = CompanyApi::getOne($companyId);
|
|
|
$where = [];
|
|
|
$whereRaw = "";
|
|
|
- if ($company_info['code'] != 'super') {
|
|
|
+ if ($company_info['code'] != 'super' && !self::chkUserInSuperusers()) {
|
|
|
$where[] = ['type', '=', session('user')['type']];
|
|
|
if (session('user')['type'] == 1) {
|
|
|
$whr[] = ["companyId", "=", $companyId];
|
|
@@ -343,7 +343,7 @@ class EnterpriseApi {
|
|
|
$company_info = CompanyApi::getOne($companyId);
|
|
|
$where = [];
|
|
|
$whereRaw = "";
|
|
|
- if ($company_info['code'] != 'super') {
|
|
|
+ if ($company_info['code'] != 'super' && !self::chkUserInSuperusers()) {
|
|
|
$where[] = ['type', '=', session('user')['type']];
|
|
|
if (session('user')['type'] == 1) {
|
|
|
$whr[] = ["companyId", "=", $companyId];
|
|
@@ -534,4 +534,15 @@ class EnterpriseApi {
|
|
|
return EnterpriseRecord::findOrEmpty($id);
|
|
|
}
|
|
|
|
|
|
+ private static function getSuperusersForEnterprise() {
|
|
|
+ $superusers = getJsonConfig("../sys_config.json", "super_users_for_enterprise");
|
|
|
+ return $superusers;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static function chkUserInSuperusers() {
|
|
|
+ $superusers = self::getSuperusersForEnterprise();
|
|
|
+ $account = session("user")["account"];
|
|
|
+ return in_array($account, $superusers);
|
|
|
+ }
|
|
|
+
|
|
|
}
|