Переглянути джерело

修复管理员越权看到其它类型企业

sugangqiang 2 роки тому
батько
коміт
55640b05b6
1 змінених файлів з 3 додано та 3 видалено
  1. 3 3
      app/common/api/EnterpriseApi.php

+ 3 - 3
app/common/api/EnterpriseApi.php

@@ -24,8 +24,8 @@ class EnterpriseApi {
         $company_info = CompanyApi::getOne($companyId);
         $where = [];
         $whereRaw = "";
+        $where[] = ['type', '=', session('user')['type']];
         if ($company_info['code'] != 'super' && !self::chkUserInSuperusers()) {
-            $where[] = ['type', '=', session('user')['type']];
             if (session('user')['type'] == 1) {
                 $whr[] = ["companyId", "=", $companyId];
                 $whr[] = ["delete", "=", 0];
@@ -198,8 +198,8 @@ class EnterpriseApi {
         $company_info = CompanyApi::getOne($companyId);
         $where = [];
         $whereRaw = "";
+        $where[] = ['type', '=', session('user')['type']];
         if ($company_info['code'] != 'super' && !self::chkUserInSuperusers()) {
-            $where[] = ['type', '=', session('user')['type']];
             if (session('user')['type'] == 1) {
                 $whr[] = ["companyId", "=", $companyId];
                 $whr[] = ["delete", "=", 0];
@@ -343,8 +343,8 @@ class EnterpriseApi {
         $company_info = CompanyApi::getOne($companyId);
         $where = [];
         $whereRaw = "";
+        $where[] = ['type', '=', session('user')['type']];
         if ($company_info['code'] != 'super' && !self::chkUserInSuperusers()) {
-            $where[] = ['type', '=', session('user')['type']];
             if (session('user')['type'] == 1) {
                 $whr[] = ["companyId", "=", $companyId];
                 $whr[] = ["delete", "=", 0];