Mike 7 gadi atpakaļ
vecāks
revīzija
c50bb92d59
1 mainītis faili ar 7 papildinājumiem un 7 dzēšanām
  1. 7 7
      server/app/Helper/JpushHelper.php

+ 7 - 7
server/app/Helper/JpushHelper.php

xqd xqd
@@ -2,7 +2,7 @@
 namespace App\Helper;
 
 use JPush\Client as JPush;
-use App\Models\Push;
+//use App\Models\Push;
 use App\User;
 
 trait JpushHelper
@@ -12,15 +12,15 @@ trait JpushHelper
         $master_secret = 'f202d10301151e1816b49e55';
         $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){
             $user = User::find($userid);
         }
-        if($res&&$user&&$user->jpush){
+        if($user&&$user->jpush){
             $regId = array($user->jpush);
             $options = array(
                 'apns_production' => true,