小型在线聊天功能
表结构
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 两个表
唯物辩证关系,我的优势就是我的劣势,我的劣势也是我的优势
就如:不听老人言吃亏在眼前,尽听老人言,终生未向前

浙公网安备 33010602011771号