Commit 30551323 authored by hujun's avatar hujun

根据楼盘id获取经纪人device_id设备id

parent 31af31ed
...@@ -179,4 +179,23 @@ class GHousesToAgents extends BaseModel ...@@ -179,4 +179,23 @@ class GHousesToAgents extends BaseModel
return $select_data; return $select_data;
} }
/**
* 根据楼盘id获取经纪人device_id设备id
*
* @param $house_id
* @param int $type
* @return array|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getDevice_id($house_id, $type = 1) {
return $this->field('b.id,device_id')
->alias('a')
->join('a_agents b', 'a.agents_id = b.id','left')
->where('houses_id', $house_id)
->where('type', $type)
->select();
}
} }
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