增加技术端与客户端聊天

This commit is contained in:
贾祥聪
2025-08-21 16:06:21 +08:00
parent f937a1f9b9
commit 1b9651c3e5
5 changed files with 1057 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace app\common\model\chat;
use think\Model;
class ChatConversation extends Model
{
// 定义时间戳字段
protected $autoWriteTimestamp = 'datetime';
protected $updateTime = 'update_time';
// 关联用户
public function user()
{
return $this->belongsTo('app\common\model\user\User', 'user_id');
}
// 关联技师
public function tech()
{
return $this->belongsTo('app\common\model\tech\Tech', 'tech_id');
}
// 关联最后一条消息
public function lastMessage()
{
return $this->belongsTo('app\common\model\chat\ChatMessage', 'last_msg_id');
}
}