mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-06 21:45:36 +00:00
fix: 修复获取聊天列表的接口
This commit is contained in:
parent
11e30d5860
commit
3a13b8bf30
@ -1251,7 +1251,7 @@ class SystemController extends AbstractController
|
|||||||
})
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
// 用户列表
|
// 用户列表
|
||||||
$notUserIds = array();
|
$notUserIds = [$user->userid];
|
||||||
foreach($chatList as $chat){
|
foreach($chatList as $chat){
|
||||||
if($chat['type'] == 'user'){
|
if($chat['type'] == 'user'){
|
||||||
$notUserIds[] = $chat['dialog_user']['userid'];
|
$notUserIds[] = $chat['dialog_user']['userid'];
|
||||||
@ -1259,12 +1259,13 @@ class SystemController extends AbstractController
|
|||||||
}
|
}
|
||||||
$userList = User::select('userid','email','nickname','userimg')
|
$userList = User::select('userid','email','nickname','userimg')
|
||||||
->where('bot',0)
|
->where('bot',0)
|
||||||
->where('userid','not in',$notUserIds)
|
->where('changepass',0)
|
||||||
|
->whereNull('disable_at')
|
||||||
|
->whereNotIn('userid',$notUserIds)
|
||||||
->get()
|
->get()
|
||||||
->transform(function (User $item) {
|
->transform(function (User $item) {
|
||||||
if(!$item->avatar){
|
$item->name = $item->nickname;
|
||||||
$item->avatar = 'avatar/'.($item->nickname ?: $item->email).'.png';
|
$item->avatar = $item->userimg;
|
||||||
}
|
|
||||||
return $item;
|
return $item;
|
||||||
})
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user