Commit 210a48e5 authored by zw's avatar zw

优化下

parent abf736bb
...@@ -558,7 +558,7 @@ class AppChat extends Basic ...@@ -558,7 +558,7 @@ class AppChat extends Basic
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"agent_id" => 1 "agent_id" => 5739
);*/ );*/
if (empty($params['agent_id'])) { if (empty($params['agent_id'])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
...@@ -580,6 +580,7 @@ class AppChat extends Basic ...@@ -580,6 +580,7 @@ class AppChat extends Basic
} }
$where["to_id"] = "agent_" . $params["agent_id"]; $where["to_id"] = "agent_" . $params["agent_id"];
$where["is_read"] = 0;
$chatModel = new ChatMsg(); $chatModel = new ChatMsg();
$msg_count = $chatModel->getTotalByToId($where); $msg_count = $chatModel->getTotalByToId($where);
if ($msg_count > 0) { if ($msg_count > 0) {
......
...@@ -142,6 +142,7 @@ class ChatMsg extends Model ...@@ -142,6 +142,7 @@ class ChatMsg extends Model
$data = $this->db $data = $this->db
->where($params) ->where($params)
->count(); ->count();
return $data; return $data;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment