Commit 56e3a0d8 authored by hujun's avatar hujun

个人推送所有设备

parent 1fef593f
...@@ -47,7 +47,8 @@ class PushMessageService ...@@ -47,7 +47,8 @@ class PushMessageService
$house_data = $house->getHouseDetail('internal_title',['id'=>$house_id]); $house_data = $house->getHouseDetail('internal_title',['id'=>$house_id]);
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
$content = "【{$agent_name['store_name']}】店【{$agent_name['name']}】约带看【{$house_data['internal_title']}】商铺"; $content = "【{$agent_name['store_name']}】店【{$agent_name['name']}】约带看【{$house_data['internal_title']}】商铺";
$this->push->public_push_message_for_one($v['id'], $v['device_id'], '报备', $content); // $this->push->public_push_message_for_one($v['id'], $v['device_id'], '报备', $content);
$this->pushAgentAllDeviceId($v['id'], '报备', $content);
} }
return ; return ;
} }
...@@ -82,8 +83,11 @@ class PushMessageService ...@@ -82,8 +83,11 @@ class PushMessageService
$where['level'] = 20; $where['level'] = 20;
$agent_store = $agent->getAgentInfo('id,device_id', '', $where); $agent_store = $agent->getAgentInfo('id,device_id', '', $where);
$this->push->public_push_message_for_one($report_data['report_agent_id'], $agent_data['device_id'], $title, $content); // $this->push->public_push_message_for_one($report_data['report_agent_id'], $agent_data['device_id'], $title, $content);
$this->push->public_push_message_for_one($agent_store['id'], $agent_store['device_id'], $title, $content); // $this->push->public_push_message_for_one($agent_store['id'], $agent_store['device_id'], $title, $content);
$this->pushAgentAllDeviceId($report_data['report_agent_id'], $title, $content);
$this->pushAgentAllDeviceId($agent_store['id'], $title, $content);
return ; return ;
} }
...@@ -171,7 +175,8 @@ class PushMessageService ...@@ -171,7 +175,8 @@ class PushMessageService
$device_id = $agent->getAgentsById($id, 'device_id'); $device_id = $agent->getAgentsById($id, 'device_id');
if (!empty($device_id)) { if (!empty($device_id)) {
$result = $this->push->public_push_message_for_one($id, $device_id, $title, $content, $type, $user_id); // $result = $this->push->public_push_message_for_one($id, $device_id, $title, $content, $type, $user_id);
$result = $this->pushAgentAllDeviceId($id, $title, $content, $type, $user_id);
} }
return $result; return $result;
} }
...@@ -193,6 +198,30 @@ class PushMessageService ...@@ -193,6 +198,30 @@ class PushMessageService
$house = $order->getHouseInfoByOrderIdOne('internal_title', ['a.id'=>$order_id]); $house = $order->getHouseInfoByOrderIdOne('internal_title', ['a.id'=>$order_id]);
$agent_data = $agent->getAgentInfo('id,device_id,name', $agent_id); $agent_data = $agent->getAgentInfo('id,device_id,name', $agent_id);
$content = "{$submit_agent_name}新增成交报告,分佣方:{$agent_data['name']}[{$house['internal_title']}]商铺"; $content = "{$submit_agent_name}新增成交报告,分佣方:{$agent_data['name']}[{$house['internal_title']}]商铺";
return $this->push->public_push_message_for_one($agent_data['id'], $agent_data['device_id'], '新增分佣', $content);
// return $this->push->public_push_message_for_one($agent_data['id'], $agent_data['device_id'], '新增分佣', $content);
return $this->pushAgentAllDeviceId($agent_data['id'], '新增分佣', $content);
}
/**
* @param $id
* @param $device_id
* @param $title
* @param $content
* @param null $type
* @param null $user_id
* @return bool
*/
public function pushAgentAllDeviceId($id, $title, $content, $type = null, $user_id = null) {
$m_agent_device = new ABindingDevice();
$device_id_array = $m_agent_device->getDeviceByAgentId(['agent_id'=>$id], 'id,device_id');
foreach ($device_id_array as $k => $v) {
if (!empty($v['device_id'])) {
$this->push->public_push_message_for_one($id, $v['device_id'], $title, $content, $type, $user_id);
}
}
return true;
} }
} }
\ 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