优化代码

main
gzydong 2021-07-10 00:25:05 +08:00
parent 1e04fdc360
commit 6e99a88a85
1 changed files with 3 additions and 3 deletions

View File

@ -106,15 +106,15 @@ class GroupService extends BaseService
]);
// 加入聊天室
foreach ($friend_ids as $uid) {
SocketRoom::getInstance()->addRoomMember(strval($data['group_id']), $uid);
foreach ($friend_ids as $value) {
SocketRoom::getInstance()->addRoomMember(strval($group->id), strval($value));
}
MessageProducer::publish(MessageProducer::create(TalkMessageEvent::EVENT_TALK, [
'sender_id' => $user_id,
'receiver_id' => $group->id,
'talk_type' => TalkMode::GROUP_CHAT,
'record_id' => (int)$data['record_id']
'record_id' => $result->id
]));
return [true, $group];