AI功能提交

This commit is contained in:
wong
2025-09-17 16:51:11 +08:00
parent 706be3efd1
commit 02c94a12d5
15 changed files with 1060 additions and 10 deletions

View File

@@ -53,6 +53,9 @@ class MessageController extends BaseController
->field('id,nickname,avatar')
->find();
$v['msgInfo'] = $friend;
$v['unreadCount'] = Db::table('s2_wechat_message')
->where(['wechatFriendId' => $v['wechatFriendId'],'isRead' => 0])
->count();
}
if (!empty($v['wechatChatroomId'])){
@@ -61,12 +64,45 @@ class MessageController extends BaseController
->field('id,nickname,chatroomAvatar as avatar')
->find();
$v['msgInfo'] = $chatroom;
$v['unreadCount'] = Db::table('s2_wechat_message')
->where(['wechatChatroomId' => $v['wechatChatroomId'],'isRead' => 0])
->count();
}
}
unset($v);
return ResponseHelper::success($list);
}
public function readMessage(){
$wechatFriendId = $this->request->param('wechatFriendId', '');
$wechatChatroomId = $this->request->param('wechatChatroomId', '');
$accountId = $this->getUserInfo('s2_accountId');
if (empty($accountId)){
return ResponseHelper::error('请先登录');
}
if (empty($wechatChatroomId) && empty($wechatFriendId)){
return ResponseHelper::error('参数缺失');
}
$where = [];
if (!empty($wechatChatroomId)){
$where[] = ['wechatChatroomId','=',$wechatChatroomId];
}
if (!empty($wechatFriendId)){
$where[] = ['wechatFriendId','=',$wechatFriendId];
}
Db::table('s2_wechat_message')->where($where)->update(['isRead' => 1]);
return ResponseHelper::success([]);
}
}