$type, 'RoomId' => $roomId, 'Text' => $content ]; $data = model('api/Tencent')->send_group_system_notification('room'.$roomId,json_encode($text)); if($data['code'] == 0){ Log::record("腾讯发送群消息:".$data['msg'].$type,"info"); }else{ Log::record("腾讯发送群消息:".$data['msg'].$type,"info"); } } //指定用户发送给谁单聊消息 public function sendMsgToUser($userId,$ToUserId,$content,$type = 2000) { //type 2000 发起PK /* * $text = [ 'SendUserId' => $create_user_id,//发送者id 'SendUserName' => db::name('user')->where('id', $create_user_id)->value('nickname'),//发送者昵称 'RoomId' => $room_id_a,//发起者所在房间id 'AcceptRoomId' => $room_id_b,//接受者所在房间id 'Text' => 'PK邀请', ]; */ $text = [ 'MsgType' => $type, 'ToUserId' => $ToUserId, 'Text' => $content ]; //谁发送给谁,什么消息,是否同步到发送者1是,2否,消息是否只下发给在线用户 1 是,0 否 model('Tencent')->user_sendmsg($userId,$ToUserId,json_encode($text),2,1); } }