合并优化

This commit is contained in:
kuaifan
2022-03-10 17:44:57 +08:00
parent 48b7f4924e
commit 43c51d48d9
77 changed files with 505 additions and 1552 deletions

View File

@@ -54,14 +54,26 @@ class WebSocketDialog extends AbstractModel
public function deleteDialog()
{
AbstractModel::transaction(function () {
WebSocketDialogMsgRead::whereDialogId($this->id)->whereNull('read_at')->update([
'read_at' => Carbon::now()
]);
WebSocketDialogMsgRead::whereDialogId($this->id)
->whereNull('read_at')
->chunkById(100, function ($list) {
WebSocketDialogMsgRead::onlyMarkRead($list);
});
$this->delete();
});
return true;
}
/**
* 还原会话
* @return bool
*/
public function recoveryDialog()
{
$this->restore();
return true;
}
/**
* 获取对话(同时检验对话身份)
* @param $dialog_id