feat: 新增自定义撤回及修改消息时限

This commit is contained in:
kuaifan
2025-03-14 21:07:44 +08:00
parent cf5e126eaa
commit 957201804c
6 changed files with 90 additions and 6 deletions

View File

@@ -539,10 +539,6 @@ class WebSocketDialogMsg extends AbstractModel
*/
public function withdrawMsg()
{
$send_dt = Carbon::parse($this->created_at)->addDay();
if ($send_dt->lt(Carbon::now())) {
throw new ApiException('已超过24小时此消息不能撤回');
}
AbstractModel::transaction(function() {
$deleteRead = WebSocketDialogMsgRead::whereMsgId($this->id)->whereNull('read_at')->delete(); // 未阅读记录不需要软删除,直接删除即可
$this->delete();