Commit d1e30900 authored by zw's avatar zw

bug

parent 34d82cd9
...@@ -609,23 +609,29 @@ class AppChat extends Basic ...@@ -609,23 +609,29 @@ class AppChat extends Basic
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"agent_id" => 5775 "agent_id" => 5775,
"user_id" => 123,
);*/ );*/
if (empty($params['agent_id'])) { if (empty($params['agent_id']) && empty($params['user_id'])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
//todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读 //todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读
$param["addressee_id"] = $params["agent_id"]; if (!empty($params['agent_id'])){
$param["is_read"] = 0; $param["addressee_id"] = $params["agent_id"];
//TODO 获取未读个数 $param["is_read"] = 0;
$msgModel = new MPushMessage(); //TODO 获取未读个数
$param["type"] = array("in", "1,2,3,8"); $msgModel = new MPushMessage();
$shop_count = $msgModel->getListCountByWhere($param); $param["type"] = array("in", "1,2,3,8");
if ($shop_count > 0) { $shop_count = $msgModel->getListCountByWhere($param);
return $this->response("200", "success", ["is_show_red" => true]); if ($shop_count > 0) {
return $this->response("200", "success", ["is_show_red" => true]);
}
$where["to_id"] = "agent_" . $params["agent_id"];
}else{
$where["to_id"] = "user_" . $params["agent_id"];
} }
$where["to_id"] = "agent_" . $params["agent_id"];
$where["is_read"] = 0; $where["is_read"] = 0;
$chatModel = new ChatMsg(); $chatModel = new ChatMsg();
$msg_count = $chatModel->getTotalByToId($where); $msg_count = $chatModel->getTotalByToId($where);
......
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