mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-03 07:37:05 +00:00
fix: 员工删除后对话还存在的问题
This commit is contained in:
parent
e2b2da8b46
commit
11308829a6
@ -84,16 +84,32 @@ class WebSocketDialog extends AbstractModel
|
||||
if ($dialog_user->userid === 0) {
|
||||
$dialog_user->userid = $userid;
|
||||
}
|
||||
$this->name = User::userid2nickname($dialog_user->userid);
|
||||
$basic = User::userid2basic($dialog_user->userid);
|
||||
if ($basic) {
|
||||
$this->name = $basic->nickname;
|
||||
} else {
|
||||
$this->name = 'non-existent';
|
||||
$this->dialog_delete = 1;
|
||||
}
|
||||
$this->dialog_user = $dialog_user;
|
||||
break;
|
||||
case "group":
|
||||
if ($this->group_type === 'project') {
|
||||
$this->group_info = Project::withTrashed()->select(['id', 'name', 'archived_at', 'deleted_at'])->whereDialogId($this->id)->first()?->cancelAppend()->cancelHidden();
|
||||
$this->name = $this->group_info ? $this->group_info->name : '';
|
||||
if ($this->group_info) {
|
||||
$this->name = $this->group_info->name;
|
||||
} else {
|
||||
$this->name = '[Delete]';
|
||||
$this->dialog_delete = 1;
|
||||
}
|
||||
} elseif ($this->group_type === 'task') {
|
||||
$this->group_info = ProjectTask::withTrashed()->select(['id', 'name', 'complete_at', 'archived_at', 'deleted_at'])->whereDialogId($this->id)->first()?->cancelAppend()->cancelHidden();
|
||||
$this->name = $this->group_info ? $this->group_info->name : '';
|
||||
if ($this->group_info) {
|
||||
$this->name = $this->group_info->name;
|
||||
} else {
|
||||
$this->name = '[Delete]';
|
||||
$this->dialog_delete = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -414,7 +414,7 @@ export default {
|
||||
if ($A.getDialogUnread(dialog) > 0 || dialog.id == this.dialogId || dialog.top_at) {
|
||||
return true
|
||||
}
|
||||
if (dialog.name === undefined) {
|
||||
if (dialog.name === undefined || dialog.dialog_delete === 1) {
|
||||
return false;
|
||||
}
|
||||
if (!dialog.last_at) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user