From 023446e0a87728727a787553ce2230219f58d65e Mon Sep 17 00:00:00 2001 From: shibafu Date: Thu, 21 May 2020 23:58:58 +0900 Subject: [PATCH] =?UTF-8?q?CSV=E3=82=A4=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=AE=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF=E3=82=A4?= =?UTF-8?q?=E3=83=B3=E3=81=AF=E3=81=8A=E6=83=A3=E8=8F=9C=E3=82=B3=E3=83=BC?= =?UTF-8?q?=E3=83=8A=E3=83=BC=E3=81=AB=E8=A1=A8=E7=A4=BA=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Ejaculation.php | 6 ++++++ app/Http/Controllers/HomeController.php | 1 + app/Http/Controllers/TimelineController.php | 1 + 3 files changed, 8 insertions(+) diff --git a/app/Ejaculation.php b/app/Ejaculation.php index a270f40..8392469 100644 --- a/app/Ejaculation.php +++ b/app/Ejaculation.php @@ -47,6 +47,12 @@ class Ejaculation extends Model return $this->hasMany(Like::class); } + public function scopeOnlyWebCheckin(Builder $query) + { + return $query->where('ejaculations.source', null) + ->orWhere('ejaculations.source', '<>', Ejaculation::SOURCE_CSV); + } + public function scopeWithLikes(Builder $query) { if (Auth::check()) { diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index f62f8e6..8619e49 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -70,6 +70,7 @@ SQL ->select('ejaculations.*') ->with('user', 'tags') ->withLikes() + ->onlyWebCheckin() ->take(21) ->get(); diff --git a/app/Http/Controllers/TimelineController.php b/app/Http/Controllers/TimelineController.php index 2f05b71..08e1d68 100644 --- a/app/Http/Controllers/TimelineController.php +++ b/app/Http/Controllers/TimelineController.php @@ -17,6 +17,7 @@ class TimelineController extends Controller ->select('ejaculations.*') ->with('user', 'tags') ->withLikes() + ->onlyWebCheckin() ->paginate(21); return view('timeline.public')->with(compact('ejaculations'));