Commit b0424090 authored by hujun's avatar hujun

单推增加循环

parent 06f73fb6
......@@ -123,34 +123,53 @@ class GeTuiUntils {
return $template;
}
/**
* 对某个人推送消息-公共
*
* zhuwei
*
* 2017-11-07 10:31:27
* @author zhuwei
* @param $id
* @param $device_id
* @param $title
* @param $content
* @return array|void
*/
function public_push_message_for_one($id, $device_id, $title, $content)
{
$homeurl = $this->http_host();
$data['agent_id'] =$id;
$data['agent_id'] = $id;
$data['black_title'] = $title;
$data['content'] = $content;
$data['device_id'] = $device_id;
$data['touchuan'] = json_encode(array(
'title' => $title,
'content' => $content,
'type' => 'other',
'url' => '',
'name' => $title,
'id' => '69',
'imageUrl' => $homeurl .'notice_android_logo.png'));
return $this->push_message_for_one($data);
$data['content'] = $content;
if (is_array($device_id)) {
foreach ($device_id as $k=>$v) {
$data['device_id'] = $v;
$data['touchuan'] = json_encode(array(
'title' => $title,
'content' => $content,
'type' => 'other',
'url' => '',
'name' => $title,
'id' => '69',
'imageUrl' => $homeurl .'notice_android_logo.png'));
$this->push_message_for_one($data);
}
return ;
} else {
$data['device_id'] = $device_id;
$data['touchuan'] = json_encode(array(
'title' => $title,
'content' => $content,
'type' => 'other',
'url' => '',
'name' => $title,
'id' => '69',
'imageUrl' => $homeurl .'notice_android_logo.png'));
return $this->push_message_for_one($data);
}
}
public function http_host()
{
$http_type =
......
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