瀏覽代碼

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

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