Commit 7f4f294c authored by hujun's avatar hujun

u_user_agent

parent 4d4dec0a
...@@ -1140,30 +1140,6 @@ class AAgents extends BaseModel ...@@ -1140,30 +1140,6 @@ class AAgents extends BaseModel
return $result; return $result;
} }
/**
* 获取用户的客方经纪人
*
* @param string $field
* @param array $params
* @param int $house_id
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getUserAgent($field = '', $params = [], $house_id = 0)
{
$data = $this->field($field)->alias('a')
->join('u_evaluate b', 'a.id = b.agents_id', 'left')
->join('g_houses_to_agents c', 'a.id=c.agents_id', 'left')
->join('u_users d', 'a.id = d.agent_id', 'left')
->where('c.houses_id', $house_id)
->where('c.type', 1)
->where($params)
->find();
return $data;
}
/** /**
* 查找客方经纪人 * 查找客方经纪人
* *
...@@ -1178,7 +1154,8 @@ class AAgents extends BaseModel ...@@ -1178,7 +1154,8 @@ class AAgents extends BaseModel
{ {
return $this->field($field)->alias('a') return $this->field($field)->alias('a')
->join('u_evaluate b', 'a.id = b.agents_id', 'left') ->join('u_evaluate b', 'a.id = b.agents_id', 'left')
->join('u_users c', 'a.id = c.agent_id', 'left') ->join('u_user_agent d', 'a.id=d.agent_id', 'left')
->join('u_users c', 'd.user_id = c.id', 'left')
->where($params) ->where($params)
->find(); ->find();
} }
...@@ -1732,7 +1709,8 @@ class AAgents extends BaseModel ...@@ -1732,7 +1709,8 @@ class AAgents extends BaseModel
public function getAgentUser($field, $where) { public function getAgentUser($field, $where) {
return $this->alias('a') return $this->alias('a')
->field($field) ->field($field)
->join('u_users b','a.id = b.agent_id', 'left') ->join('u_user_agent d', 'a.id=d.agent_id', 'left')
->join('u_users b','d.user_id = b.id', 'left')
->where($where) ->where($where)
->find(); ->find();
} }
......
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