|
|
@ -296,6 +296,9 @@ class Im extends BaseController |
|
|
} |
|
|
} |
|
|
$toContactId=$v['is_group'] ==1 ? 'group-'.$v['to_user'] : $v['to_user']; |
|
|
$toContactId=$v['is_group'] ==1 ? 'group-'.$v['to_user'] : $v['to_user']; |
|
|
$atList=($v['at'] ?? null) ? explode(',',$v['at']): []; |
|
|
$atList=($v['at'] ?? null) ? explode(',',$v['at']): []; |
|
|
|
|
|
if (!is_numeric($v['create_time'])) { |
|
|
|
|
|
$v['create_time'] = strtotime($v['create_time']); |
|
|
|
|
|
} |
|
|
$data[] = [ |
|
|
$data[] = [ |
|
|
'msg_id' => $v['msg_id'], |
|
|
'msg_id' => $v['msg_id'], |
|
|
'id' => $v['id'], |
|
|
'id' => $v['id'], |
|
|
@ -817,7 +820,7 @@ class Im extends BaseController |
|
|
if($message['from_user']!=$this->userInfo['user_id']){ |
|
|
if($message['from_user']!=$this->userInfo['user_id']){ |
|
|
return warning(lang('system.noAuth')); |
|
|
return warning(lang('system.noAuth')); |
|
|
} |
|
|
} |
|
|
Message::where(['id' => $id])->delete(); |
|
|
$message->delete(); |
|
|
// 如果是最后一条消息,需要将上一条设置为最后一条 |
|
|
// 如果是最后一条消息,需要将上一条设置为最后一条 |
|
|
if($message['is_last']){ |
|
|
if($message['is_last']){ |
|
|
Message::where(['chat_identify'=>$message['chat_identify']])->order('msg_id desc')->limit(1)->update(['is_last'=>1]); |
|
|
Message::where(['chat_identify'=>$message['chat_identify']])->order('msg_id desc')->limit(1)->update(['is_last'=>1]); |
|
|
|