Commit d1e30900 authored by zw's avatar zw

bug

parent 34d82cd9
......@@ -609,12 +609,14 @@ class AppChat extends Basic
{
$params = $this->params;
/* $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", "请求参数错误");
}
//todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读
if (!empty($params['agent_id'])){
$param["addressee_id"] = $params["agent_id"];
$param["is_read"] = 0;
//TODO 获取未读个数
......@@ -626,6 +628,10 @@ class AppChat extends Basic
}
$where["to_id"] = "agent_" . $params["agent_id"];
}else{
$where["to_id"] = "user_" . $params["agent_id"];
}
$where["is_read"] = 0;
$chatModel = new ChatMsg();
$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