Commit c04405f7 authored by hujun's avatar hujun

推送人去重

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