perf: 优化自己的对话不限修改撤回时间

This commit is contained in:
kuaifan
2025-04-14 13:18:38 +08:00
parent dcf96e2bf5
commit 923016197a
2 changed files with 17 additions and 3 deletions

View File

@@ -666,6 +666,18 @@ class WebSocketDialog extends AbstractModel
Task::deliver($task);
}
/**
* 检查是否是单人对话
* @return bool
*/
public function isSelfDialog()
{
if ($this->type !== 'user') {
return false;
}
return WebSocketDialogUser::whereDialogId($this->id)->where('userid', '>', 0)->count() === 1;
}
/**
* 获取对话(同时检验对话身份)
* @param $dialog_id