Commit d17ba1bc authored by clone's avatar clone Committed by hujun

聊天关系

parent c60455d6
...@@ -16,6 +16,7 @@ use app\model\Agents; ...@@ -16,6 +16,7 @@ use app\model\Agents;
use app\model\ChatMsg; use app\model\ChatMsg;
use app\model\ChatMsgExt; use app\model\ChatMsgExt;
use app\model\ChatMsgStatus; use app\model\ChatMsgStatus;
use app\model\ChatRelation;
use app\model\ChatUser; use app\model\ChatUser;
use app\model\Users; use app\model\Users;
...@@ -287,6 +288,18 @@ class ChatService ...@@ -287,6 +288,18 @@ class ChatService
} }
} }
/**
* @param $target
* @param $from
*/
private function verifyRelation($target, $from){
$chatRelationModel = new ChatRelation();
$param["to_id"] =
$chatRelationModel->getChatRelation();
//getChatRelation
}
/** /**
* 记录消息body * 记录消息body
* @param $id * @param $id
......
<?php
namespace app\model;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/2/6
* Time : 16:07
* Intro:
*/
use think\Model;
use think\Db;
class ChatRelation extends Model
{
// 设置当前模型对应的完整数据表名称
protected $table = 'chat_relation';
protected $db_;
public function __construct()
{
$this->db_ = Db($this->table);
}
public function getChatRelation($params, $field = "id,to_id,from_id")
{
return $this->db->field($field)
->where($params)
->find();
}
public function addChatRelation($params)
{
Db::startTrans();
try {
$this->insert($params);
Db::commit();
} catch (\Exception $e) {
Db::rollback();
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment