Commit e83da410 by 冷斌

update

parent 9ca9c211
...@@ -724,6 +724,41 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -724,6 +724,41 @@ class Model_Live extends PhalApi_Model_NotORM {
} }
public function jpush($data)
{
$configpri=getConfigPri();
/* 极光推送 */
$app_key = $configpri['jpush_key'];
$master_secret = $configpri['jpush_secret'];
if(empty($app_key) || empty($master_secret) ){
return;
}
$apns_production=false;
if($configpri['jpush_sandbox']){
$apns_production=true;
}
require_once SITE_PATH.'api/public/JPush/autoload.php';
$client = new \JPush\Client($app_key, $master_secret,null);
$title = '中奖全房间通知';
try{
$client->push()
->setPlatform('all')
->message($title, [
'title' => $title,
'extras' => $data,
])
->addRegistrationId(null)
->options(array(
'sendno' => 100,
'time_to_live' => 0,
'apns_production' => $apns_production,
))
->send();
}catch (\Exception $exception) {
}
}
/* 赠送礼物 */ /* 赠送礼物 */
public function sendGift($uid,$liveuid,$stream,$giftid,$giftcount) { public function sendGift($uid,$liveuid,$stream,$giftid,$giftcount) {
...@@ -737,6 +772,12 @@ class Model_Live extends PhalApi_Model_NotORM { ...@@ -737,6 +772,12 @@ class Model_Live extends PhalApi_Model_NotORM {
return 1002; return 1002;
} }
$this->jpush([
'liveuid' => $liveuid,
'stream' => $stream,
'uid' => $uid,
]);
$total= $giftinfo['needcoin']*$giftcount; $total= $giftinfo['needcoin']*$giftcount;
$addtime=time(); $addtime=time();
......
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