diff --git a/app/Service/TalkService.php b/app/Service/TalkService.php index 4a4e1c1..ac95bd3 100644 --- a/app/Service/TalkService.php +++ b/app/Service/TalkService.php @@ -159,6 +159,11 @@ class TalkService extends BaseService ->orWhere([['user_id', '=', $receiver_id], ['receiver_id', '=', $user_id]]); })->where('talk_type', $talk_type)->pluck('id'); } else {// 群聊信息 + // 判读是否属于群消息并且判断是否是群成员 + if ($talk_type == TalkModeConstant::GROUP_CHAT && !di()->get(GroupMemberService::class)->isMember($receiver_id, $user_id)) { + return false; + } + $ids = TalkRecords::whereIn('id', $record_ids)->where('talk_type', TalkModeConstant::GROUP_CHAT)->pluck('id'); } @@ -167,11 +172,6 @@ class TalkService extends BaseService return false; } - // 判读是否属于群消息并且判断是否是群成员 - if ($talk_type == TalkModeConstant::GROUP_CHAT && !di()->get(GroupMemberService::class)->isMember($receiver_id, $user_id)) { - return false; - } - $data = array_map(function ($record_id) use ($user_id) { return [ 'record_id' => $record_id,