Commit 9c61fd05 by 冷斌

fix bug

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