From a7054831b9e190ab8d135cca5478b83d40ca7b13 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 3 Aug 2023 11:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=98=AF=E5=90=A6=E6=98=AF?= =?UTF-8?q?=E9=98=9F=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/CompanyController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/api/controller/CompanyController.php b/app/api/controller/CompanyController.php index fa7f38335..6d785d851 100644 --- a/app/api/controller/CompanyController.php +++ b/app/api/controller/CompanyController.php @@ -93,14 +93,21 @@ class CompanyController extends BaseApiController return $this->success('success', ['count' => $count, 'data' => $data]); } + /** + * 公司人员 + */ public function users() { [$page, $limit] = $this->getPage(); - // $companyId = $this->request->param('company_id', 0); + $params = $this->request->param(); // if($companyId==0){ // $companyId=$this->userInfo['company_id']; // } - $query = User::where('company_id', $this->userInfo['company_id']); + $wehre[]=['company_id','=',$this->userInfo['company_id']]; + if(isset($params['is_captain'])&& $params['is_captain']==1){ + $wehre[]= ['is_captain','=',1]; + } + $query = User::where($wehre); $count = $query->count(); $users = $query->page($page)->limit($limit)->with(['company' => function ($query) { $query->field('id,company_name');