mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-03 18:28:11 +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->send = WebSocketDialogMsgRead::whereMsgId($msg->id)->count();
|
||||||
$msg->save();
|
$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 = [];
|
$umengUserid = [];
|
||||||
foreach ($array as $item) {
|
foreach ($array as $item) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user