Commit 9c7e61df authored by clone's avatar clone

bug

parent 97a31205
......@@ -322,9 +322,9 @@ class AppChat extends Basic
public function getChatRelation()
{
$params = $this->params;
/* $params = array(
"target" => "agent_5739", //当前用户
"is_user" => 1,//0用户1经纪人
/* $params = array(
"target" => "user_2", //当前用户
"is_user" => 0,//0用户1经纪人
"relation_list" => '[{"r_id":"2","msg_id":3536},{"r_id":"8","msg_id":3524}]',
);*/
if (!isset($params['target']) || !isset($params["is_user"])) {
......
......@@ -79,7 +79,7 @@ class ChatRelation extends Model
$whereOr_["disable"] = 0;
$date = $this->field($field)
->alias("a")
->join("chat_user b","a.to_id != '".$only_id."' and a.to_id=b.only_id or a.from_id=b.only_id","left")
->join("chat_user b","b.only_id != '".$only_id."' and (a.to_id=b.only_id or a.from_id=b.only_id)","left")
->join("a_agents c","b.type = 1 and b.user_id = c.id","left")
->join("u_users d","b.type =2 and b.user_id=d.id","left")
->where($where_)
......@@ -88,7 +88,7 @@ class ChatRelation extends Model
})
->group("a.to_id,a.from_id")
->select();
// echo $this->getLastSql();
echo $this->getLastSql();
return $date;
}
......
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