public function save() { $content = Input::get('content'); $notice_type = Input::get('notice_type'); $notice_id = Input::get('notice_id'); $notice_url = Input::get('notice_url'); $custom_content = ['notice_type' => $notice_type, 'notice_id' => $notice_id, 'notice_url' => $notice_url]; $account_ids = Input::get('account_ids'); $push_type = Input::get('push_type', 'all'); $push = new BPushService(); switch ($push_type) { case 'batch': $push->pushBatchMessage(explode(',', $account_ids), $content, $custom_content); break; case 'android': $push->pushAllAndroidMessage($content, $custom_content); break; case 'ios': $push->pushAllIosMessage($content, $custom_content); break; default: $push->pushAllMessage($content, $custom_content); break; } PushMessage::create(['content' => $content, 'account_ids' => $account_ids, 'push_type' => $push_type, 'notice_id' => $notice_id, 'notice_type' => $notice_type, 'notice_url' => $notice_url]); $res = array('result' => true, 'content' => '提交成功'); return $res; }
public function push() { $content = Input::get('content'); $account_id = Input::get('account_id'); $push = new BPushService(); $push->pushSingleMessage($account_id, $content); $push->pushBatchMessage([1, 2], $content); }