|
@@ -2,7 +2,7 @@
|
|
namespace App\Helper;
|
|
namespace App\Helper;
|
|
|
|
|
|
use JPush\Client as JPush;
|
|
use JPush\Client as JPush;
|
|
-use App\Models\Push;
|
|
|
|
|
|
+//use App\Models\Push;
|
|
use App\User;
|
|
use App\User;
|
|
|
|
|
|
trait JpushHelper
|
|
trait JpushHelper
|
|
@@ -12,15 +12,15 @@ trait JpushHelper
|
|
$master_secret = 'f202d10301151e1816b49e55';
|
|
$master_secret = 'f202d10301151e1816b49e55';
|
|
$client = new JPush($app_key, $master_secret, storage_path('logs/jpush.log'));
|
|
$client = new JPush($app_key, $master_secret, storage_path('logs/jpush.log'));
|
|
|
|
|
|
- $push = new Push;
|
|
|
|
- $push->title = $title;
|
|
|
|
- $push->content = $content;
|
|
|
|
- $push->user_id = $userid;
|
|
|
|
- $res=$push->save();
|
|
|
|
|
|
+// $push = new Push;
|
|
|
|
+// $push->title = $title;
|
|
|
|
+// $push->content = $content;
|
|
|
|
+// $push->user_id = $userid;
|
|
|
|
+// $res=$push->save();
|
|
if($userid){
|
|
if($userid){
|
|
$user = User::find($userid);
|
|
$user = User::find($userid);
|
|
}
|
|
}
|
|
- if($res&&$user&&$user->jpush){
|
|
|
|
|
|
+ if($user&&$user->jpush){
|
|
$regId = array($user->jpush);
|
|
$regId = array($user->jpush);
|
|
$options = array(
|
|
$options = array(
|
|
'apns_production' => true,
|
|
'apns_production' => true,
|