diff --git a/app/middleapi/controller/AccountLogController.php b/app/middleapi/controller/AccountLogController.php index 8d529776b..c9d10ecef 100644 --- a/app/middleapi/controller/AccountLogController.php +++ b/app/middleapi/controller/AccountLogController.php @@ -29,11 +29,14 @@ class AccountLogController extends BaseLikeAdminController if(!$this->request->isPost()){ return $this->fail('请求方式错误'); } - $params = $this->request->post(['page_no','page_size', 'start_time', 'end_time', 'type','company_id']); + $params = $this->request->post(['page_no','page_size', 'start_time', 'end_time', 'user_info', 'type', 'change_type', 'company_id']); $where = []; if (isset($params['type']) && $params['type'] == 'um') { $where[] = ['change_type', 'in', AccountLogEnum::getUserMoneyChangeType()]; } + if (!empty($params['change_type'])) { + $where[] = ['change_type', '=', $params['change_type']]; + } if (!empty($params['company_id'])) { $where[] = ['company_id', '=', $params['company_id']]; } 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",