Commit f8e8e5e9 authored by zhuwei's avatar zhuwei

聊天客户详情

parent 7f43582d
......@@ -22,6 +22,7 @@ use app\model\GHousesImgs;
use app\model\HouseImgs;
use app\model\HouseinfoExts;
use app\model\HouseInfos;
use app\model\Users;
use think\Cache;
use think\Exception;
use Think\Log;
......@@ -359,6 +360,8 @@ class AppChat extends Basic
}
/**
* 获取聊天关系
* @return \think\Response
......@@ -399,5 +402,43 @@ class AppChat extends Basic
}
/**
* 获取聊天客户信息
* @return \think\Response
*/
public function getUserInfoByFrom()
{
$params = $this->params;
$params = array(
'id' => 1,
);
if (!isset($params['id'])) {
return $this->response("300", "参数不全");
}
//获取客户信息
//1.客户头像 user_pic other_pic
//2.姓名 昵称 user_nick user_name
//3.ID
//4.手机号隐藏中间4位
$user = new Users();
$field = 'a.id,a.user_name,a.user_nick,a.user_phone,a.user_pic,a.other_pic';
$params_["a.id"] = $params['id'];
$result = $user->getAgentByUserId($field, $params_);
if (count($result) > 0) {
$result_["id"] = $result[0]["id"];
$result_["user_name"] = $result[0]["user_name"];
$result_["user_nick"] = $result[0]["user_nick"];
$result_["img"] = !empty($result[0]["user_pic"]) ? HEADERIMGURL . $result[0]["user_pic"] : $result[0]["other_pic"];
$result_["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $result[0]["user_phone"]);
return $this->response("200", "success!", $result_);
} else {
return $this->response("400", "暂无数据!");
}
}
}
......@@ -396,6 +396,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' ] ],
'getUserInfoByFrom' => [ 'chat/AppChat/getUserInfoByFrom', [ 'method' => 'post|get' ] ],
'getChatRelation' => [ 'chat/AppChat/getChatRelation', [ 'method' => 'post|get' ] ],
]);
......
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