From 437494071df6c91137b1358d3897b4f1963d8f18 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 18 Aug 2023 11:01:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/controller/CompanyController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/adminapi/controller/CompanyController.php b/app/adminapi/controller/CompanyController.php index 2590389f3..b8c559e84 100644 --- a/app/adminapi/controller/CompanyController.php +++ b/app/adminapi/controller/CompanyController.php @@ -25,6 +25,7 @@ use app\common\model\Company; use think\facade\Db; use app\common\logic\contract\ContractLogic; use app\common\model\contract\Contract; +use app\common\model\user\User; /** * Company控制器 @@ -229,8 +230,12 @@ class CompanyController extends BaseAdminController */ public function subordinate($company_id) { - $company = Company::findOrEmpty($company_id); - $result = loopGetChild(Company::class, $company->id, 'level_one', 'company_name,id,company_type,area,area area_name,street,street street_name,is_contract,area_manager,area_manager area_manager_name,master_name,master_phone'); + $ids=Contract::where('party_a',$company_id)->where('status',1)->where('type',1)->column('party_b'); + if($ids){ + $result=Company::where('id','in',$ids)->field('company_name,id,company_type,area,area area_name,street,street street_name,is_contract,area_manager,area_manager area_manager_name,master_name,master_phone')->select(); + }else{ + $result=[]; + } $data['lists'] = $result; return $this->success('success', $data); }