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

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
J
Java Code Geeks
月光博客
月光博客
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Jina AI
Jina AI
小众软件
小众软件
U
Unit 42
云风的 BLOG
云风的 BLOG
Stack Overflow Blog
Stack Overflow Blog
雷峰网
雷峰网
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
宝玉的分享
宝玉的分享
B
Blog
C
Check Point Blog
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
量子位
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News
酷 壳 – CoolShell
酷 壳 – CoolShell

博客园 - 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  两个表

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

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