From fce5569a743da811ea2370c7b1bf896b508a8b4b Mon Sep 17 00:00:00 2001 From: gzydong <837215079@qq.com> Date: Sun, 7 Nov 2021 22:40:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=BF=81=E7=A7=BB=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/TalkService.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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,