Procházet zdrojové kódy

Merge branch 'gq' of http://git.9026.com/roobe/miao

Mike před 7 roky
rodič
revize
4a4a3f2776

+ 11 - 9
server/app/Http/Controllers/Api/V1/InteractionController.php

xqd xqd
@@ -146,9 +146,19 @@ class InteractionController extends Controller
         if (!empty($request->input('comment_user_id'))) {
             $to_user = UserInfoModel::find($request->input('comment_user_id'));
             if (!empty($to_user)){
-                $data['comment_info_id'] = $request->input('comment_user_id');
+                $data['to_user_id'] = $request->input('comment_user_id');
                 $data['to_user_avatar'] = $to_user->avatar;
                 $data['to_user_nickname'] = $to_user->nickname;
+
+                $message = $user->nickname.'在你的互动上留言啦!点击去看看!';
+                $info = [
+                    'user_id' => $data['to_user_id'],
+                    'message' => $message,
+                ];
+                SystemInfoModel::create($info);
+
+//            长连接
+                $this->jPush($message,'',$data['to_user_id']);
             }
         }
 
@@ -160,15 +170,7 @@ class InteractionController extends Controller
         $data['is_read'] = 1;
         $ok = CommentInfoModel::create($data);
 
-        $message = $user->nickname.'在你的互动上留言啦!点击去看看!';
-        $info = [
-            'user_id' => $data['to_user_id'],
-            'message' => $message,
-        ];
-        SystemInfoModel::create($info);
 
-//            长连接
-        $this->jPush($message,'',$data['to_user_id']);
         if ($ok) {
             return $this->api('');
         }else{