Commit bf97a983 by HanSon

member改回旧形式

1 parent a7d85f3a
...@@ -110,11 +110,9 @@ class ContactFactory ...@@ -110,11 +110,9 @@ class ContactFactory
$groupAccount['MemberList'] = $group['MemberList']; $groupAccount['MemberList'] = $group['MemberList'];
$groupAccount['ChatRoomId'] = $group['EncryChatRoomId']; $groupAccount['ChatRoomId'] = $group['EncryChatRoomId'];
group()->put($group['UserName'], $groupAccount); group()->put($group['UserName'], $groupAccount);
$members = [];
foreach ($group['MemberList'] as $member) { foreach ($group['MemberList'] as $member) {
$members[$member['UserName']] = $member; member()->put($member['UserName'], $member);
} }
member()->put($group['UserName'], $members);
} }
} }
......
...@@ -33,29 +33,4 @@ class Member extends Collection ...@@ -33,29 +33,4 @@ class Member extends Collection
return static::$instance; return static::$instance;
} }
/**
* 根据昵称获取群成员
*
* @param $groupUsername
* @param $memberNickname
* @param bool $blur
* @return array'
*/
public function getMembersByNickname($groupUsername, $memberNickname, $blur = false)
{
$members = $this->get($groupUsername);
$result = [];
foreach ($members as $username => $member) {
if ($blur && str_contains($member['NickName'], $memberNickname)) {
$result[] = $member;
} elseif (!$blur && $member['NickName'] === $memberNickname) {
$result[] = $member;
}
}
return $result;
}
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!