From 02d02d40b38e8f773459fb43b13b164736220a66 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq.com> Date: Mon, 16 Jun 2025 15:24:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/manage/controller/Index.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/app/manage/controller/Index.php b/app/manage/controller/Index.php index d4d7674..b862aa9 100644 --- a/app/manage/controller/Index.php +++ b/app/manage/controller/Index.php @@ -10,11 +10,30 @@ namespace app\manage\controller; use app\BaseController; -use app\enterprise\model\{Message}; -use think\facade\Cache; +use app\enterprise\model\{Message,User,Group,File}; +use GatewayClient\Gateway; class Index extends BaseController { // 超级管理员专属功能 + public function index(){ + Gateway::$registerAddress = config('gateway.registerAddress'); + $client_id=$this->request->param('client_id',''); + $is_join=0; + if($client_id){ + Gateway::joinGroup($client_id, 'admin-manage'); + $is_join=1; + } + $data=[ + 'userCount'=>User::where(['status'=>1])->count(), + 'groupCount'=>Group::where(['status'=>1])->count(), + 'messageCount'=>Message::where(['status'=>1])->where([['type', 'not in', ['event','admin_notice','webrtc']]])->count(), + 'fileCount'=>File::where(['status'=>1])->count(), + 'onlineCount'=>Gateway::getAllUidCount() ?? 0, + 'clientCount'=>Gateway::getAllClientCount() ?? 0, + 'isJoin'=>$is_join, + ]; + return success('', $data); + } // 清理消息 public function clearMessage(){