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
24bb5e8f
Commit
24bb5e8f
authored
Nov 12, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化下
parent
c8479b2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
AppChat.php
application/chat/controller/AppChat.php
+6
-2
ChatMsg.php
application/model/ChatMsg.php
+1
-0
No files found.
application/chat/controller/AppChat.php
View file @
24bb5e8f
...
@@ -256,7 +256,7 @@ class AppChat extends Basic
...
@@ -256,7 +256,7 @@ class AppChat extends Basic
if
(
!
empty
(
$params
[
"last_msg_id"
])
&&
$params
[
"last_msg_id"
]
>
0
)
{
if
(
!
empty
(
$params
[
"last_msg_id"
])
&&
$params
[
"last_msg_id"
]
>
0
)
{
$where_arr
[
"from"
]
=
$params
[
"from"
];
$where_arr
[
"from"
]
=
$params
[
"from"
];
$where_arr
[
"target"
]
=
$params
[
"target"
];
$where_arr
[
"target"
]
=
$params
[
"target"
];
$update_arr
[
"is_read"
]
=
0
;
$update_arr
[
"is_read"
]
=
1
;
$msgModel
->
updateIsRead
(
$where_arr
,
$update_arr
);
$msgModel
->
updateIsRead
(
$where_arr
,
$update_arr
);
}
}
...
@@ -535,6 +535,7 @@ class AppChat extends Basic
...
@@ -535,6 +535,7 @@ class AppChat extends Basic
//修改已读消息
//修改已读消息
if
(
!
empty
(
$params
[
'read_ids'
]))
{
if
(
!
empty
(
$params
[
'read_ids'
]))
{
$where_arr
[
"id"
]
=
array
(
"in"
,
$params
[
"read_ids"
]);
$where_arr
[
"id"
]
=
array
(
"in"
,
$params
[
"read_ids"
]);
$where_arr
[
"is_read"
]
=
0
;
$update_arr
[
"is_read"
]
=
1
;
$update_arr
[
"is_read"
]
=
1
;
$msgModel
->
updateIsRead
(
$where_arr
,
$update_arr
);
$msgModel
->
updateIsRead
(
$where_arr
,
$update_arr
);
}
}
...
@@ -558,6 +559,9 @@ class AppChat extends Basic
...
@@ -558,6 +559,9 @@ class AppChat extends Basic
/* $params = array(
/* $params = array(
"agent_id" => 1
"agent_id" => 1
);*/
);*/
if
(
empty
(
$params
[
'agent_id'
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
//todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读
//todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读
$param
[
"addressee_id"
]
=
$params
[
"agent_id"
];
$param
[
"addressee_id"
]
=
$params
[
"agent_id"
];
$param
[
"type"
]
=
2
;
$param
[
"type"
]
=
2
;
...
@@ -579,7 +583,7 @@ class AppChat extends Basic
...
@@ -579,7 +583,7 @@ class AppChat extends Basic
if
(
$msg_count
>
0
)
{
if
(
$msg_count
>
0
)
{
return
$this
->
response
(
"200"
,
"success"
,
[
"is_show_red"
=>
true
]);
return
$this
->
response
(
"200"
,
"success"
,
[
"is_show_red"
=>
true
]);
}
}
return
$this
->
response
(
"200"
,
"success"
,
[
"is_show_red"
=>
false
]);
}
}
...
...
application/model/ChatMsg.php
View file @
24bb5e8f
...
@@ -95,6 +95,7 @@ class ChatMsg extends Model
...
@@ -95,6 +95,7 @@ class ChatMsg extends Model
if
(
isset
(
$where_arr
[
"target"
]))
{
if
(
isset
(
$where_arr
[
"target"
]))
{
$where_
[
"to_id"
]
=
$where_arr
[
"target"
];
$where_
[
"to_id"
]
=
$where_arr
[
"target"
];
}
}
$where_
[
"is_read"
]
=
0
;
if
(
empty
(
$where_
)){
if
(
empty
(
$where_
)){
return
false
;
return
false
;
}
}
...
...
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