From 4c72de93097d6fe5e6a1b49aa2f4094ea9c0a68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=B3=E6=B8=85=E7=88=BD?= Date: Wed, 23 Apr 2025 17:45:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=AE=A1=E5=90=8E=E5=8F=B0=20-=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=AD=90=E8=B4=A6=E5=8F=B7=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/superadmin/config/route.php | 1 + ...GetCompanySubusersForProfileController.php | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Server/application/superadmin/controller/company/GetCompanySubusersForProfileController.php diff --git a/Server/application/superadmin/config/route.php b/Server/application/superadmin/config/route.php index d1bada0a..d1adbc4f 100644 --- a/Server/application/superadmin/config/route.php +++ b/Server/application/superadmin/config/route.php @@ -42,5 +42,6 @@ Route::group('', function () { Route::get('detail/:id', 'app\superadmin\controller\company\GetCompanyDetailForUpdateController@index'); Route::get('profile/:id', 'app\superadmin\controller\company\GetCompanyDetailForProfileController@index'); Route::get('devices', 'app\superadmin\controller\company\GetCompanyDevicesForProfileController@index'); + Route::get('subusers', 'app\superadmin\controller\company\GetCompanySubusersForProfileController@index'); }); })->middleware(['app\superadmin\middleware\AdminAuth']); \ No newline at end of file diff --git a/Server/application/superadmin/controller/company/GetCompanySubusersForProfileController.php b/Server/application/superadmin/controller/company/GetCompanySubusersForProfileController.php new file mode 100644 index 00000000..a6949d7b --- /dev/null +++ b/Server/application/superadmin/controller/company/GetCompanySubusersForProfileController.php @@ -0,0 +1,45 @@ + $this->request->param('companyId/d', 0), + 'isAdmin' => 0 + ]; + + return UserModel::field('id,account,username,avatar,status,createTime,typeId')->where($where)->select()->toArray(); + } + + /** + * 获取公司关联的设备列表 + * + * @return \think\response\Json + */ + public function index() + { + $users = $this->getSubusers(); + + foreach ($users as &$user) { + $user['createTime'] = date('Y-m-d H:i:s', $user['createTime']); + } + + return ResponseHelper::success($users); + } +} \ No newline at end of file