From 75585f8e5f5ed1f9a7e5765968020f3c0f4a439d Mon Sep 17 00:00:00 2001 From: weiz Date: Mon, 20 Nov 2023 09:42:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=AC=E5=8F=B8=E6=88=90?= =?UTF-8?q?=E5=91=98=E5=AF=B9=E5=A4=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CompanyController.php | 56 ++++++++++++++++++- composer.json | 3 +- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/app/middleapi/controller/CompanyController.php b/app/middleapi/controller/CompanyController.php index 07f2c74fc..a52d22fe2 100644 --- a/app/middleapi/controller/CompanyController.php +++ b/app/middleapi/controller/CompanyController.php @@ -3,9 +3,11 @@ namespace app\middleapi\controller; use app\adminapi\logic\auth\AdminLogic; + use app\adminapi\logic\user\UserLogic; use app\adminapi\validate\CompanyValidate; use app\api\controller\JunziqianController; use app\common\controller\BaseLikeAdminController; + use app\common\enum\user\UserTerminalEnum; use app\common\logic\CompanyLogic; use app\common\logic\contract\ContractLogic; use app\common\logic\RedisLogic; @@ -17,6 +19,7 @@ use app\common\model\task_scheduling\TaskScheduling; use app\common\model\user\User; use app\common\model\CompanyDepositVoucher; + use Exception; use think\facade\Db; use think\facade\Log; use think\response\Json; @@ -330,7 +333,7 @@ return $this->success('success', array_unique($data)); } - public function getDepositRechargeTransferVoucherList() + public function getDepositRechargeTransferVoucherList(): Json { if(!$this->request->isPost()){ return $this->fail('请求方式错误'); @@ -358,7 +361,7 @@ return $this->success('请求成功',$result); } - public function depositRechargeTransferVoucher() + public function depositRechargeTransferVoucher(): Json { if(!$this->request->isPost()){ return $this->fail('请求方式错误'); @@ -416,7 +419,7 @@ } - public function getPartyA() + public function getPartyA(): Json { if(!$this->request->isPost()){ return $this->fail('请求方式错误'); @@ -431,4 +434,51 @@ } return $this->success('成功', $re); } + + //获取公司成员 + public function companyUserLists(): Json + { + if(!$this->request->isPost()){ + return $this->fail('请求方式错误'); + } + $params = $this->request->post(['company_id','page_no','page_size']); + if(empty($params['company_id'])){ + return $this->fail('参数错误'); + } + $pageNo = !empty($params['page_no']) ? $params['page_no'] : 1; + $pageSize = !empty($params['page_size']) ? $params['page_size'] : 20; + $field = "id,id contract,sn,nickname,sex,avatar,account,mobile,channel,create_time,admin_id,company_id,street,street as street_name,is_contract"; + $lists = User::with(['company']) + ->where('company_id',$params['company_id']) + ->page($pageNo, $pageSize) + ->field($field) + ->order('id desc') + ->select() + ->toArray(); + foreach ($lists as &$item) { + $item['channel'] = UserTerminalEnum::getTermInalDesc($item['channel']); + } + $count = User::where('company_id',$params['company_id'])->count(); + $result = [ + 'lists' => $lists, + 'count' => $count, + 'page_no' => $pageNo, + 'page_size' => $pageSize + ]; + return $this->success('请求成功',$result); + } + + //获取公司成员详情 + public function companyUserDetail(): Json + { + if(!$this->request->isPost()){ + return $this->fail('请求方式错误'); + } + $params = $this->request->post(['user_id']); + if(empty($params['user_id'])){ + return $this->fail('参数错误'); + } + $detail = UserLogic::detail($params['user_id']); + return $this->success('', $detail); + } } \ No newline at end of file diff --git a/composer.json b/composer.json index 9214adbec..78f70ae3c 100755 --- a/composer.json +++ b/composer.json @@ -44,7 +44,8 @@ "jpush/jpush": "^3.6", "topthink/think-filesystem": "^2.0", "alibabacloud/live": "^1.8", - "alibabacloud/live-20161101": "1.1.1" + "alibabacloud/live-20161101": "1.1.1", + "ext-bcmath": "*" }, "require-dev": { "symfony/var-dumper": "^4.2",