diff --git a/app/adminapi/lists/CompanyLists.php b/app/adminapi/lists/CompanyLists.php index 6a046ac3c..c281d4752 100644 --- a/app/adminapi/lists/CompanyLists.php +++ b/app/adminapi/lists/CompanyLists.php @@ -56,7 +56,12 @@ class CompanyLists extends BaseAdminDataLists implements ListsSearchInterface */ public function lists(): array { + $where=[]; + if($this->adminInfo['root']!=1){ + $where['area_manager']=$this->adminId; + } return Company::where($this->searchWhere) + ->where($where) ->field(['is_authentication','id', 'level_two', 'level_one', 'company_name', 'organization_code', 'city', 'area', 'street', 'company_type', 'master_name', 'master_position', 'master_phone', 'master_email', 'other_contacts', 'area_manager', 'is_contract', 'deposit', 'deposit_time', 'qualification', 'status']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc'])