|
@@ -16,7 +16,7 @@ class UserMessage extends Model
|
|
|
2=>['title'=>'图文审核','msg'=>['恭喜您图文审核成功','抱歉啦图文审核失败~~']],
|
|
|
3=>['title'=>'图文评论回复','msg'=>['']],
|
|
|
4=>['title'=>'图文评论','msg'=>['']],
|
|
|
- ],
|
|
|
+ ],//图文
|
|
|
'datum'=>[
|
|
|
1=>['title'=>'资料投稿','msg'=>['资料投稿成功请等待审核']],
|
|
|
2=>['title'=>'资料审核','msg'=>['恭喜您资料审核成功','抱歉啦资料审核失败~~']],
|
|
@@ -39,11 +39,14 @@ class UserMessage extends Model
|
|
|
5=>['title'=>'论坛回复','msg'=>['']],
|
|
|
],// 论坛
|
|
|
'press'=>[
|
|
|
-
|
|
|
+ 1=>['title'=>'评论回复','msg'=>['']],
|
|
|
],// 新闻
|
|
|
- 'supplier'=>[],// 供应商
|
|
|
- 'recruit'=>[],// 招聘
|
|
|
- 'mall'=>[],// 商城
|
|
|
+ 'mall'=>[
|
|
|
+
|
|
|
+ ],// 商城
|
|
|
+ 'feedback'=>[
|
|
|
+ 1=>['title'=>'反馈内容回复','msg'=>['平台回复了您的反馈']],
|
|
|
+ ],// 反馈
|
|
|
];
|
|
|
|
|
|
/**
|
|
@@ -71,5 +74,45 @@ class UserMessage extends Model
|
|
|
}
|
|
|
|
|
|
|
|
|
+ function new_push($worker_id = 0,$alert = '您有一个新订单,请及时处理',$sound='sound.caf'){
|
|
|
+ if(empty($worker_id)) return false;
|
|
|
+ $appKey = '02a7faefd91c8a6a446a6a14';
|
|
|
+ $masterSecret = 'ba2e100db997024d9b6e5d35';
|
|
|
+ $client = new \JPush\Client($appKey, $masterSecret,null);
|
|
|
+ $push_payload = $client->push()
|
|
|
+ ->setPlatform(array('ios', 'android'))
|
|
|
+ ->addAlias(strval($worker_id))
|
|
|
+ ->iosNotification($alert, array(
|
|
|
+ 'badge' => '+1',
|
|
|
+ 'content-available' => true,
|
|
|
+ 'mutable-content' => true,
|
|
|
+ 'sound' => $sound,
|
|
|
+ 'category' => 'jiguang',
|
|
|
+ 'extras' => array(
|
|
|
+ 'key' => 'value',
|
|
|
+ 'jiguang'
|
|
|
+ ),
|
|
|
+ ))->androidNotification($alert, array(
|
|
|
+ 'title' => '消息通知',
|
|
|
+ // 'builder_id' => 2,
|
|
|
+ 'extras' => array(
|
|
|
+ 'key' => 'value',
|
|
|
+ 'jiguang'
|
|
|
+ ),
|
|
|
+ ))->options(array(
|
|
|
+ 'apns_production' => True,
|
|
|
+ ));
|
|
|
+ try {
|
|
|
+ $response = $push_payload->send();
|
|
|
+ return $response;
|
|
|
+ } catch (\JPush\Exceptions\APIConnectionException $e) {
|
|
|
+ return $e;
|
|
|
+ } catch (\JPush\Exceptions\APIRequestException $e) {
|
|
|
+ return $e;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|