惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
J
Java Code Geeks
A
About on SuperTechFans
F
Fortinet All Blogs
B
Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
博客园_首页
博客园 - 叶小钗
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
云风的 BLOG
云风的 BLOG

博客园 - tying

fastadmin mongodb 处理及使用 mysql的知识扩展 <论语> fastadmin配合宝塔面板造成cors error 跨域问题 一个小并发,引起的数据错误 fastadmin数据库操作 技术文章分享 shopxo学习过程 fastadmin 開發好文章 fastadmin常用前端组件 2024-11-13关于监管特殊停牌炒作股票事件--兼此事件复盘 深入浅出的讲解mysql优化 关于gruop by,where和order by ,以及一些mysql的探讨 fastadmin使用感受 fastadmin命令行模式--command mac 下Fastadmin 框架搭建 Mac电脑php环境搭建 关于php+mysql性能在实际工作中的应用实例 yii2的单元测试 d8的入口文件及引申
小型在线聊天功能
tying · 2025-08-08 · via 博客园 - tying

表结构

chat_content(聊天内容)
id, content,type(文字,图片、简历、工作),tid(和消息类型关联的id),from_user_id,ship_id ,createtime,nickname,avatar,is_read


chat_relationship(聊天成员关联关系)
id,createtime,relationship(发送方和接收放的userid,中间用_连接,需要排序),type(消息类型,user,system,group,方便拓展),user_id

聊天内容列表,关联关系,   chat_content>chat_relationship where ship_id = relationship

消息列表     chat_relationship >chat_content   where from_user_id !=自己 and 

chat_room.user_id  = 自己 

is_read == 0(此处为非必要)  on chat_relationship .relationship= chat_content.relationship

此处因为是简易聊天,缺失一张chat_room表,用chart_relationship  代替了chat_room、chart_relationship  两个表

唯物辩证关系,我的优势就是我的劣势,我的劣势也是我的优势

就如:不听老人言吃亏在眼前,尽听老人言,终生未向前