소스 검색

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

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];