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
32ae843e
Commit
32ae843e
authored
Jul 09, 2018
by
hujun
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'chat_0705' of gitee.com:zwyjjc/tl_estate into chat_0705
parents
2dd269da
2afe265b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
2 deletions
+47
-2
AppChat.php
application/chat/controller/AppChat.php
+30
-2
ChatService.php
application/chat/service/ChatService.php
+16
-0
route.php
application/route.php
+1
-0
No files found.
application/chat/controller/AppChat.php
View file @
32ae843e
...
...
@@ -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
);
}
}
application/chat/service/ChatService.php
View file @
32ae843e
...
...
@@ -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
...
...
application/route.php
View file @
32ae843e
...
...
@@ -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'
,
[
...
...
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