Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
f8e8e5e9
Commit
f8e8e5e9
authored
Aug 30, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
聊天客户详情
parent
7f43582d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
AppChat.php
application/chat/controller/AppChat.php
+41
-0
route.php
application/route.php
+1
-0
No files found.
application/chat/controller/AppChat.php
View file @
f8e8e5e9
...
...
@@ -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"
,
"暂无数据!"
);
}
}
}
application/route.php
View file @
f8e8e5e9
...
...
@@ -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'
]
],
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment