mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 03:03:41 +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) {
|
if ($dialog_user->userid === 0) {
|
||||||
$dialog_user->userid = $userid;
|
$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;
|
$this->dialog_user = $dialog_user;
|
||||||
break;
|
break;
|
||||||
case "group":
|
case "group":
|
||||||
if ($this->group_type === 'project') {
|
if ($this->group_type === 'project') {
|
||||||
$this->group_info = Project::withTrashed()->select(['id', 'name', 'archived_at', 'deleted_at'])->whereDialogId($this->id)->first()?->cancelAppend()->cancelHidden();
|
$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') {
|
} 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->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;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -414,7 +414,7 @@ export default {
|
|||||||
if ($A.getDialogUnread(dialog) > 0 || dialog.id == this.dialogId || dialog.top_at) {
|
if ($A.getDialogUnread(dialog) > 0 || dialog.id == this.dialogId || dialog.top_at) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (dialog.name === undefined) {
|
if (dialog.name === undefined || dialog.dialog_delete === 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!dialog.last_at) {
|
if (!dialog.last_at) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user