浏览代码

Update AccountController

Daniel Supernault 6 年之前
父节点
当前提交
6e798f3f75
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/Http/Controllers/AccountController.php

+ 3 - 1
app/Http/Controllers/AccountController.php

@@ -64,10 +64,12 @@ class AccountController extends Controller
       ]);
         $profile = Auth::user()->profile;
         $action = $request->input('a');
+        $allowed = ['like', 'follow'];
         $timeago = Carbon::now()->subMonths(3);
         $following = $profile->following->pluck('id');
         $notifications = Notification::whereIn('actor_id', $following)
-          ->where('profile_id', '!=', $profile->id)
+          ->whereIn('action', $allowed)
+          ->where('actor_id', '<>', $profile->id)
           ->whereDate('created_at', '>', $timeago)
           ->orderBy('notifications.created_at', 'desc')
           ->simplePaginate(30);