Commit cdd14064 authored by hujun's avatar hujun

推送人去重

parent c04405f7
......@@ -48,7 +48,7 @@ class PushMessageService
$house = new GHouses();
$m_report = new OReportModel();
$data = $house_agent->getHousesAgents($house_id, 'b.id', [ 'a.type' => $type,'a.is_del'=>0 ]);
$data = $house_agent->getHousesAgentsPush($house_id, 'b.id', [ 'a.type' => $type,'a.is_del'=>0 ]);
$agent_name = $agent->getAgentsStoreById([ 'a.id' => $agent_id ], 'name,store_name');
$house_data = $house->getHouseDetail('internal_title', [ 'id' => $house_id ]);
$order_id = $m_report->getReportOrder('b.id',['a.report_agent_id'=>$agent_id]);
......
......@@ -286,6 +286,31 @@ class GHousesToAgents extends BaseModel
* @throws \think\exception\DbException
*/
public function getHousesAgents($houses_id, $field = 'b.id,name,a.type,b.phone', $where = '')
{
$select_data = $this->field($field)->alias('a')
->join('a_agents b', 'a.agents_id = b.id', 'LEFT')
->where([
'houses_id' => $houses_id,
'is_del' => 0
])
->where($where)
->select();
return $select_data;
}
/**
* 楼盘对应的经纪人信息
*
* @param $houses_id
* @param string $field
* @param string $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getHousesAgentsPush($houses_id, $field = 'b.id,name,a.type,b.phone', $where = '')
{
$select_data = $this->field($field)->alias('a')
->join('a_agents b', 'a.agents_id = b.id', 'LEFT')
......
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