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
e400b472
Commit
e400b472
authored
Jul 22, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
f4db0488
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
AppChat.php
application/chat/controller/AppChat.php
+9
-8
ChatMsg.php
application/model/ChatMsg.php
+5
-1
No files found.
application/chat/controller/AppChat.php
View file @
e400b472
...
...
@@ -193,14 +193,15 @@ class AppChat extends Basic
public
function
getChatHistory
()
{
$params
=
$this
->
params
;
/* $params = array(
'target_type' => 'users', // 消息类型 users 用户消息。chatgroups: 群消息,chatrooms: 聊天室消息
'from' => 'agent_5740', //发送人
'target' => 'agent_5741', //接受人
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
if
(
!
isset
(
$params
[
'target_type'
])
||
!
isset
(
$params
[
'from'
])
||
!
isset
(
$params
[
'target'
]))
{
/* $params = array(
'target_type' => 'users', // 消息类型 users 用户消息。chatgroups: 群消息,chatrooms: 聊天室消息
'from' => 'agent_5740', //发送人
'last_msg_id' => 123, //最后一条消息id 默认0 表示不处理
'target' => 'agent_5741', //接受人
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
if
(
!
isset
(
$params
[
'target_type'
])
||
!
isset
(
$params
[
'from'
])
||
!
isset
(
$params
[
'target'
])
||
!
isset
(
$params
[
'last_msg_id'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
}
...
...
application/model/ChatMsg.php
View file @
e400b472
...
...
@@ -61,6 +61,10 @@ class ChatMsg extends Model
if
(
isset
(
$params
[
"body"
]))
{
$where_
[
"b.body"
]
=
array
(
'like'
,
"%"
.
trim
(
$params
[
"body"
])
.
"%"
);
}
if
(
isset
(
$params
[
"last_msg_id"
])
&&
$params
[
"last_msg_id"
]
>
0
)
{
$where_
[
"b.id"
]
=
array
(
'>'
,
$params
[
"last_msg_id"
]
);
$where_or
[
"b.id"
]
=
array
(
'>'
,
$params
[
"last_msg_id"
]
);
}
$where_
[
"a.is_del"
]
=
0
;
$data
=
$this
->
db
->
field
(
$field
)
...
...
@@ -74,7 +78,7 @@ class ChatMsg extends Model
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
select
();
//
echo $this->getLastSql();
echo
$this
->
getLastSql
();
return
$data
;
}
...
...
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