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
257f13f3
Commit
257f13f3
authored
Nov 12, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chat
parent
cd4bf09a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
3 deletions
+45
-3
AppChat.php
application/chat/controller/AppChat.php
+0
-0
ChatMsg.php
application/model/ChatMsg.php
+41
-1
route.php
application/route.php
+4
-2
No files found.
application/chat/controller/AppChat.php
View file @
257f13f3
This diff is collapsed.
Click to expand it.
application/model/ChatMsg.php
View file @
257f13f3
...
...
@@ -82,6 +82,36 @@ class ChatMsg extends Model
return
$data
;
}
/** 批量更新已看记录
* @param array $where_arr
* @param array $update_arr
* @return bool
*/
public
function
updateIsRead
(
array
$where_arr
,
array
$update_arr
){
$where_
=
[];
if
(
isset
(
$where_arr
[
"from"
]))
{
$where_
[
"from_id"
]
=
$where_arr
[
"from"
];
}
if
(
isset
(
$where_arr
[
"target"
]))
{
$where_
[
"to_id"
]
=
$where_arr
[
"target"
];
}
if
(
empty
(
$where_
)){
return
false
;
}
try
{
$this
->
db
->
where
(
$where_
)
->
update
(
$update_arr
);
return
true
;
}
catch
(
\Exception
$e
)
{
return
false
;
}
}
/**
* @param $params
* @param $field
* @return mixed
*/
public
function
getTotalUnread
(
$params
,
$field
)
{
...
...
@@ -96,7 +126,9 @@ class ChatMsg extends Model
}
$where_
[
"a.is_del"
]
=
0
;
$data
=
$this
->
db
->
field
(
$field
)
$data
=
$this
->
db
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
'chat_msg_ext b'
,
'a.id = b.msg_id'
,
'LEFT'
)
->
where
(
$where_
)
...
...
@@ -105,4 +137,11 @@ class ChatMsg extends Model
return
$data
;
}
public
function
getTotalByToId
(
$params
){
$data
=
$this
->
db
->
where
(
$params
)
->
count
();
return
$data
;
}
}
\ No newline at end of file
application/route.php
View file @
257f13f3
...
...
@@ -458,6 +458,7 @@ Route::group('chat', [
'getSystemMessageByShop'
=>
[
'chat/AppChat/getSystemMessageByShop'
,
[
'method'
=>
'post|get'
]],
'getSystemMessageByUser'
=>
[
'chat/AppChat/getSystemMessageByUser'
,
[
'method'
=>
'post|get'
]],
'updateSystemMessageIsRead'
=>
[
'chat/AppChat/updateSystemMessageIsRead'
,
[
'method'
=>
'post|get'
]],
'getMessageIsRead'
=>
[
'chat/AppChat/getMessageIsRead'
,
[
'method'
=>
'post|get'
]],
]);
...
...
@@ -668,8 +669,8 @@ Route::group('broker', [
'getSiteListApp'
=>
[
'api_broker/Site/getSiteList'
,
[
'method'
=>
'POST|GET'
]],
//获取站点列表
'getAgentSiteList'
=>
[
'api_broker/Site/getAgentSiteList'
,
[
'method'
=>
'POST|GET'
]
],
//获取经纪人站点列表
'getPhoneBook'
=>
[
'api_broker/Agent/getPhoneBook'
,
[
'method'
=>
'POST|GET'
]
],
//消息页面--通讯录
'getAgentSiteList'
=>
[
'api_broker/Site/getAgentSiteList'
,
[
'method'
=>
'POST|GET'
]
],
//获取经纪人站点列表
'getPhoneBook'
=>
[
'api_broker/Agent/getPhoneBook'
,
[
'method'
=>
'POST|GET'
]
],
//消息页面--通讯录
]);
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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