Commit 1e593cb3 authored by hujun's avatar hujun

经纪人查询

parent 068a73a7
......@@ -20,6 +20,7 @@ use app\model\AAgentsBlackListImg;
use app\model\ABindingDevice;
use app\model\AOperatingRecords;
use app\model\AStore;
use app\model\AuthGroupSite;
use app\model\Evaluate;
use app\model\GHousesToAgents;
use app\model\GOperatingRecords;
......@@ -110,8 +111,12 @@ class Broker extends Basic
$where['district_id'] = $this->params['district_id'];
}
if ($this->params['site_id'] && ($this->userId != 1)) {
$where['site_id'] = $this->params['site_id'];
if ($this->userId != 1) {
$group_site = new AuthGroupSite();
$agent_model = new AAgents();
$auth_group_id = $agent_model->getAgentFieldById($this->userId, 'auth_group_id');
$site_id = $group_site->getAgentField('site_id', ['group_id'=>$auth_group_id]);
$where['site_id'] = ['in', $site_id];
}
if ($this->params['position'] == -1) {
......
......@@ -69,4 +69,14 @@ class AuthGroupSite extends BaseModel
return $data;
}
/**
* @param $id
* @param $fields
* @return mixed
*/
public function getAgentField($fields, $where)
{
return $this->where($where)->value($fields);
}
}
\ No newline at end of file
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