Browse Source

自动消息提醒返回增加参数

master
wanghongjun 6 months ago
parent
commit
1a463eb895
  1. 1
      app/enterprise/controller/Group.php
  2. 19
      app/enterprise/model/Message.php

1
app/enterprise/controller/Group.php

@ -584,6 +584,7 @@ class Group extends BaseController
$is_close = $day ? 0 : 1;
$data = Message::setAutoDelMessageNotice($uid, $group_id,$title, 1, $is_close);
$data['isMobile'] = $this->request->isMobile() ? 1 : 0;
wsSendMsg($group_id, 'undoMessage', $data, 1);
return success('', $data);

19
app/enterprise/model/Message.php

@ -354,6 +354,7 @@ class Message extends BaseModel
if ($is_close) $content = '关闭了自动删除计时器';
$data=[
'id' => \utils\Str::getUuid(),
'from_user'=>$from_user,
'to_user'=>$to_user,
'content'=>str_encipher($content,true),
@ -375,6 +376,24 @@ class Message extends BaseModel
$msgInfo['sendTime'] = $data['create_time'];
$msgInfo['toContactId'] = $msgInfo['is_group'] == 1 ? $msgInfo['chat_identify'] : $to_user;
$msgInfo['status']='successd';
$userList = User::matchUser([$msgInfo], true, 'from_user', 120);
$fromUser = $userList[$from_user];
if ($is_group) {
$msgInfo['content'] = $fromUser['realname'] . $data['content'];
} else {
$msgInfo['content'] = lang('im.you'). $data['content'];
}
$msgInfo['formUser'] = $fromUser;
$msgInfo['download'] = '';
$msgInfo['extUrl'] = '';
$msgInfo['extends'] = null;
$msgInfo['fileName'] = null;
$msgInfo['fileSize'] = 0;
$msgInfo['file_cate'] = 0;
$msgInfo['file_id'] = 0;
$msgInfo['from_user'] = $from_user;
$msgInfo['preview'] = "";
$msgInfo['toContactId'] = $to_user;
return $msgInfo;
}
}
Loading…
Cancel
Save