| | |
| | | $conversationModel = new ConversationModel(); |
| | | |
| | | // 检查是否已存在会话 |
| | | $conversation = $conversationModel->getConversationByBusinessCard($businessCardId); |
| | | $conversation = $conversationModel->getConversationByBusinessCardUser($businessCardId,$userId); |
| | | |
| | | if ($businessCard['user_id'] == $userId&&!$conversation) { |
| | | return $this->renderError('不能与自己建立会话'); |
| | | } |
| | | if (!$conversation) { |
| | | |
| | | // 创建新会话 |
| | | $participants = [$userId, $businessCard['user_id']]; |
| | | $conversationId = $conversationModel->createConversation($businessCardId, $participants); |