|
@@ -50,6 +50,9 @@ class WebSocketController implements OnMessageInterface, OnOpenInterface, OnClos
|
|
//存入队列
|
|
//存入队列
|
|
$result = json_decode($frame->data, true);
|
|
$result = json_decode($frame->data, true);
|
|
$result['user_id'] = $userId;
|
|
$result['user_id'] = $userId;
|
|
|
|
+
|
|
|
|
+ $show_id = $result['show_id'];
|
|
|
|
+
|
|
var_dump($result, '-------------1----');
|
|
var_dump($result, '-------------1----');
|
|
$userInfo = $redisClient->getUserInfo((string) $userId);
|
|
$userInfo = $redisClient->getUserInfo((string) $userId);
|
|
if ($userInfo) {
|
|
if ($userInfo) {
|
|
@@ -122,7 +125,7 @@ class WebSocketController implements OnMessageInterface, OnOpenInterface, OnClos
|
|
if ($server->isEstablished((int) $fd)) {
|
|
if ($server->isEstablished((int) $fd)) {
|
|
$data = $result;
|
|
$data = $result;
|
|
|
|
|
|
- $data['is_read'] = 1;
|
|
|
|
|
|
+ $data['is_read'] = 0;
|
|
$server->push((int) $fd, json_encode(value: $data));
|
|
$server->push((int) $fd, json_encode(value: $data));
|
|
var_dump('消息给好友发送成功' . $fd);
|
|
var_dump('消息给好友发送成功' . $fd);
|
|
// 尝试连接
|
|
// 尝试连接
|
|
@@ -183,7 +186,7 @@ class WebSocketController implements OnMessageInterface, OnOpenInterface, OnClos
|
|
$chatdata['receiver_id'] = $result['receiver_id'];
|
|
$chatdata['receiver_id'] = $result['receiver_id'];
|
|
$chatdata['user_id'] = $val['user_id'];
|
|
$chatdata['user_id'] = $val['user_id'];
|
|
$chatdata['group_receiver_id'] = $result['user_id'];
|
|
$chatdata['group_receiver_id'] = $result['user_id'];
|
|
- $chatdata['is_read'] = 1;
|
|
|
|
|
|
+ $chatdata['is_read'] = 0;
|
|
$chatdata['action'] = 'recieved';
|
|
$chatdata['action'] = 'recieved';
|
|
$message = new MqProducer($chatdata);
|
|
$message = new MqProducer($chatdata);
|
|
$producer = ContextApplicationContext::getContainer()->get(Producer::class);
|
|
$producer = ContextApplicationContext::getContainer()->get(Producer::class);
|