Files
anmo/server/app/common/model/chat/ChatConversation.php
2025-08-21 16:06:21 +08:00

31 lines
652 B
PHP

<?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');
}
}