Commit 3f6a1834 authored by hujun's avatar hujun

客户冻结推送

parent 80d38385
...@@ -216,16 +216,17 @@ class PushMessageService ...@@ -216,16 +216,17 @@ class PushMessageService
* @param $content * @param $content
* @param null $type * @param null $type
* @param null $user_id * @param null $user_id
* @param int $is_forbidden
* @return array|bool * @return array|bool
*/ */
public function pushAgentAllDeviceId($id, $title, $content, $type = null, $user_id = null) public function pushAgentAllDeviceId($id, $title, $content, $type = null, $user_id = null, $is_forbidden = 0)
{ {
if (empty($id)) { if (empty($id)) {
return false; return false;
} }
$m_agent_device = new ABindingDevice(); $m_agent_device = new ABindingDevice();
$device_id_array = $m_agent_device->getDeviceByAgentId([ 'agent_id' => $id, 'is_forbidden' => 0 ], 'id,push_id'); $device_id_array = $m_agent_device->getDeviceByAgentId([ 'agent_id' => $id, 'is_forbidden' => $is_forbidden, 'is_pc'=>0 ], 'id,push_id');
$result = []; $result = [];
if (!empty($device_id_array)) { if (!empty($device_id_array)) {
foreach ($device_id_array as $k => $v) { foreach ($device_id_array as $k => $v) {
...@@ -288,7 +289,7 @@ class PushMessageService ...@@ -288,7 +289,7 @@ class PushMessageService
$title = $type = ''; $title = $type = '';
$m_push = new MPushMessage(); $m_push = new MPushMessage();
$field = 'id,addressee_id,type,message,house_id,user_id'; $field = 'id,addressee_id,type,message,house_id,user_id';
$where['status'] = $id = 0; $where['status'] = $id = $is_forbidden = 0;
$push_data = $m_push->getDateLimit($field, $where, 100); $push_data = $m_push->getDateLimit($field, $where, 100);
foreach ($push_data['data'] as $k => $v) { foreach ($push_data['data'] as $k => $v) {
...@@ -316,9 +317,10 @@ class PushMessageService ...@@ -316,9 +317,10 @@ class PushMessageService
$title = '账号冻结'; $title = '账号冻结';
$id = $v['addressee_id']; $id = $v['addressee_id'];
$type = 'down_line'; $type = 'down_line';
$is_forbidden = 1;
} }
$result = $this->pushAgentAllDeviceId($v['addressee_id'], $title, $v['message'], $type, $id); $result = $this->pushAgentAllDeviceId($v['addressee_id'], $title, $v['message'], $type, $id, $is_forbidden);
$update_data['status'] = 1; $update_data['status'] = 1;
$update_data['send_time'] = date('Y-m-d H:i:s'); $update_data['send_time'] = date('Y-m-d H:i:s');
......
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