mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-03 01:58:17 +00:00
perf: 会话消息没有接收人时已读进度优化
This commit is contained in:
parent
829ed0a575
commit
9ea1fa6df7
@ -157,6 +157,21 @@ class WebSocketDialogMsgTask extends AbstractTask
|
||||
// 更新已发送数量
|
||||
$msg->send = WebSocketDialogMsgRead::whereMsgId($msg->id)->count();
|
||||
$msg->save();
|
||||
// 没有接收人时通知发送人已读
|
||||
if ($msg->send === 0) {
|
||||
PushTask::push([
|
||||
'userid' => $msg->userid,
|
||||
'msg' => [
|
||||
'type' => 'dialog',
|
||||
'mode' => 'readed',
|
||||
'data' => [
|
||||
'id' => $msg->id,
|
||||
'read' => $msg->read,
|
||||
'percentage' => $msg->percentage,
|
||||
],
|
||||
]
|
||||
]);
|
||||
}
|
||||
// 开始推送消息
|
||||
$umengUserid = [];
|
||||
foreach ($array as $item) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user