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
6fbd9515
Commit
6fbd9515
authored
Nov 12, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chat
parent
ad91d53b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
AppChat.php
application/chat/controller/AppChat.php
+22
-0
ChatMsg.php
application/model/ChatMsg.php
+0
-6
No files found.
application/chat/controller/AppChat.php
View file @
6fbd9515
...
...
@@ -537,5 +537,27 @@ class AppChat extends Basic
$data
[
"shop_count"
]
=
$msgModel
->
getListCountByWhere
(
$param
);
return
$this
->
response
(
"200"
,
"success"
,
$data
);
}
public
function
getMessageIsRead
(){
$params
=
$this
->
params
;
$params
=
array
(
"agent_id"
=>
1
);
//todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读
$param
[
"addressee_id"
]
=
$params
[
"agent_id"
];
$param
[
"type"
]
=
2
;
//TODO 获取未读个数
$msgModel
=
new
MPushMessage
();
$user_count
=
$msgModel
->
getListCountByWhere
(
$param
);
if
(
$user_count
>
0
){
return
$this
->
response
(
"200"
,
"success"
,[
"is_show_red"
=>
true
]);
}
$param
[
"type"
]
=
1
;
$shop_count
=
$msgModel
->
getListCountByWhere
(
$param
);
if
(
$shop_count
>
0
){
return
$this
->
response
(
"200"
,
"success"
,[
"is_show_red"
=>
true
]);
}
}
}
application/model/ChatMsg.php
View file @
6fbd9515
...
...
@@ -87,15 +87,12 @@ class ChatMsg extends Model
if
(
isset
(
$params
[
"to_id"
]))
{
$where_
[
"a.to_id"
]
=
$params
[
"to_id"
];
//$where_or["a.to_id"] = $params["from"];
}
if
(
isset
(
$params
[
"from_id"
]))
{
$where_
[
"a.from_id"
]
=
$params
[
"from_id"
];
//$where_or["a.from_id"] = $params["target"];
}
if
(
isset
(
$params
[
"id"
]))
{
$where_
[
"a.id"
]
=
$params
[
"id"
];
// $where_or["a.id"] = $params["id"];
}
$where_
[
"a.is_del"
]
=
0
;
...
...
@@ -103,9 +100,6 @@ class ChatMsg extends Model
->
alias
(
"a"
)
->
join
(
'chat_msg_ext b'
,
'a.id = b.msg_id'
,
'LEFT'
)
->
where
(
$where_
)
/* ->whereOr(function ($query) use ($where_or) {
$query->where($where_or);
})*/
->
order
(
"a.created_at desc"
)
->
count
();
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