Commit 24bb5e8f authored by zw's avatar zw

优化下

parent c8479b2b
......@@ -256,7 +256,7 @@ class AppChat extends Basic
if (!empty($params["last_msg_id"]) && $params["last_msg_id"] > 0) {
$where_arr["from"] = $params["from"];
$where_arr["target"] = $params["target"];
$update_arr["is_read"] = 0;
$update_arr["is_read"] = 1;
$msgModel->updateIsRead($where_arr, $update_arr);
}
......@@ -535,6 +535,7 @@ class AppChat extends Basic
//修改已读消息
if (!empty($params['read_ids'])) {
$where_arr["id"] = array("in", $params["read_ids"]);
$where_arr["is_read"] = 0;
$update_arr["is_read"] = 1;
$msgModel->updateIsRead($where_arr, $update_arr);
}
......@@ -558,6 +559,9 @@ class AppChat extends Basic
/* $params = array(
"agent_id" => 1
);*/
if (empty($params['agent_id'])) {
return $this->response("101", "请求参数错误");
}
//todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读
$param["addressee_id"] = $params["agent_id"];
$param["type"] = 2;
......@@ -579,7 +583,7 @@ class AppChat extends Basic
if ($msg_count > 0) {
return $this->response("200", "success", ["is_show_red" => true]);
}
return $this->response("200", "success", ["is_show_red" => false]);
}
......
......@@ -95,6 +95,7 @@ class ChatMsg extends Model
if (isset($where_arr["target"])) {
$where_["to_id"] = $where_arr["target"];
}
$where_["is_read"] = 0;
if(empty($where_)){
return false;
}
......
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