增加技术端与客户端聊天
This commit is contained in:
31
server/app/common/model/chat/ChatConversation.php
Normal file
31
server/app/common/model/chat/ChatConversation.php
Normal 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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user