Browse Source

群聊新加入好友可以看到群上一条消息问题

master
wanghongjun 3 months ago
parent
commit
02f9389be7
  1. 2
      app/enterprise/model/Group.php
  2. 3
      app/enterprise/model/User.php

2
app/enterprise/model/Group.php

@ -16,7 +16,7 @@ class Group extends BaseModel
public static function getMyGroup($map){
return Db::name('group_user')
->alias('gu')
->field('gr.group_id,gr.avatar,gr.name as displayName,gu.unread,gr.name_py,gr.owner_id,gr.notice,gu.role,gu.is_notice,gu.is_top,gr.setting')
->field('gr.group_id,gr.avatar,gr.name as displayName,gu.unread,gr.name_py,gr.owner_id,gr.notice,gu.role,gu.is_notice,gu.is_top,gr.setting,gu.create_time as gu_create_time')
->join('group gr','gu.group_id=gr.group_id','left')
->where($map)
->select();

3
app/enterprise/model/User.php

@ -196,6 +196,9 @@ class User extends BaseModel
$group[$k]['is_at'] = 0;
if ($getGroupLastMsg) {
foreach ($getGroupLastMsg as $key=>$val) {
if ($val['lastSendTime'] < $v['gu_create_time']) {
continue;
}
if ($val['to_user'] == $v['group_id']) {
$group[$k]['type'] =$val['type'];
$group[$k]['lastContent'] = str_encipher($val['lastContent'],false);

Loading…
Cancel
Save