Commit 9c61fd05 by 冷斌

fix bug

parent 1e9abf31
...@@ -773,8 +773,10 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -773,8 +773,10 @@ class Model_Live extends PhalApi_Model_NotORM {
require_once dirname(dirname(__DIR__)).'/public/JPush/autoload.php'; require_once dirname(dirname(__DIR__)).'/public/JPush/autoload.php';
$client = new \JPush\Client($app_key, $master_secret,null); $client = new \JPush\Client($app_key, $master_secret,null);
$title = '中奖全房间通知'; $title = '中奖全房间通知';
$results = array_chunk($pushids, 999);
foreach ($results as $result) {
try{ try{
$stauts = $client->push() $client->push()
->setPlatform('all') ->setPlatform('all')
->message($title, [ ->message($title, [
'title' => $title, 'title' => $title,
...@@ -797,7 +799,7 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -797,7 +799,7 @@ class Model_Live extends PhalApi_Model_NotORM {
// ), // ),
// )) // ))
->addRegistrationId($pushids) ->addRegistrationId($result)
->options(array( ->options(array(
'sendno' => 100, 'sendno' => 100,
'time_to_live' => 0, 'time_to_live' => 0,
...@@ -805,11 +807,13 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -805,11 +807,13 @@ class Model_Live extends PhalApi_Model_NotORM {
)) ))
->send(); ->send();
}catch (\Exception $exception) { }catch (\Exception $exception) {
var_dump($exception->getMessage());
die;
} }
} }
}
/* 赠送礼物 */ /* 赠送礼物 */
public function sendGift($uid,$liveuid,$stream,$giftid,$giftcount) { public function sendGift($uid,$liveuid,$stream,$giftid,$giftcount) {
......
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