Commit 32ae843e authored by hujun's avatar hujun

Merge branch 'chat_0705' of gitee.com:zwyjjc/tl_estate into chat_0705

parents 2dd269da 2afe265b
......@@ -137,10 +137,12 @@ class AppChat extends Basic
return $this->response("101", "request error ,not fund list", []);
}
/**
* 发送消息接口
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function pushMsg()
{
......@@ -246,6 +248,9 @@ class AppChat extends Basic
/**
* 获取聊天商铺信息
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getHouseInfoByFrom()
{
......@@ -274,7 +279,7 @@ class AppChat extends Basic
$param["img_type"] = 1;
$images = $gHousesImgModel->getHouseImages($param, 1);
$data['$images'] = IMG_PATH . '/img/houseinfobackgroundimg_new.png';
$data['images'] = IMG_PATH . '/img/houseinfobackgroundimg_new.png';
if (count($images) > 0) {
$result["imagename"] = CK_IMG_URL . 'images/' . $images[0]["img_name"];
}
......@@ -306,5 +311,28 @@ class AppChat extends Basic
}
/**
* 获取聊天关系
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getChatRelation()
{
$params = $this->params;
/* $params = array(
"target" => "121"
);*/
if (!isset($params['target']) || !isset($params['from'])) {
return $this->response("300", "参数不全");
}
$target = $params["target"];
$relationList = $this->_chat->getRelationList($target);
return $this->response("200", "success", $relationList);
}
}
......@@ -346,6 +346,22 @@ class ChatService
}
}
/**
* 获取聊天列表
* @param $target
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getRelationList($target){
$chatRelationModel = new ChatRelation();
$params["target"] = $target;
$params["from"] = $target;
$field = "id,to_id,from_id,create_time";
return $chatRelationModel->getChatRelation($params,$field);
}
/**
* 记录消息body
* @param $id
......
......@@ -351,6 +351,7 @@ Route::group('chat', [
'addGroupManage' => [ 'chat/Group/addGroupManage', [ 'method' => 'post|get' ] ],
'delGroupManage' => [ 'chat/Group/delGroupManage', [ 'method' => 'post|get' ] ],
'pushMsg_gethouseinfo' => [ 'chat/AppChat/getHouseInfoByFrom', [ 'method' => 'post|get' ] ],
'getChatRelation' => [ 'chat/AppChat/getChatRelation', [ 'method' => 'post|get' ] ],
]);
Route::group('task', [
......
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