string(19) "7037032174@chatroom" [1] => string(20) "52468523601@chatroom" [2] => string(20) "52984126208@chatroom" } * * /api/Gechatroom/getChatroomList */ function getChatroomList() { if(cache('cache_getChatroomList_data'.session_admin_firm_id())){ $data = cache('cache_getChatroomList_data'.session_admin_firm_id()); //自带id,name return json(['list' => $data, 'total' => count($data)]); } $ai_config_id = input('ai_config_id'); if(empty($ai_config_id)){ throw new \Exception('ai_config_id不能为空'); } $logic = new GechatroomWechatLogic(); $data = $logic->getChatroomList($ai_config_id); //dump($data);die; //缓存群成员列表 cache('cache_getChatroomList_data'.session_admin_firm_id(),$data,86400); //自带id,name return json(['list' => $data, 'total' => count($data)]); } /** * 查询群成员列表 */ function getChatroomMemberList() { $chatroom_id = input('chatroom_id'); if(empty($chatroom_id)){ return json(['list' => [], 'total' => 0]); } if(cache('cache_getChatroomList_data'.session_admin_firm_id())){ $cache_data = cache('cache_getChatroomList_data'.session_admin_firm_id()); $memberList = $cache_data[$chatroom_id]['memberList']; return json(['list' => $memberList, 'total' => count($memberList)]); } $ai_config_id = input('ai_config_id'); if(empty($ai_config_id)){ throw new \Exception('ai_config_id不能为空'); } $data = (new GechatroomWechatLogic())->getChatroomList($ai_config_id); //缓存群成员列表 cache('cache_getChatroomList_data'.session_admin_firm_id(),$data['memberList'],86400); $memberList = $data[$chatroom_id]['memberList']; return json(['list' => $memberList, 'total' => count($memberList)]); } }