CSVインポートのチェックインはお惣菜コーナーに表示しない
This commit is contained in:
parent
8681c328d0
commit
023446e0a8
@ -47,6 +47,12 @@ class Ejaculation extends Model
|
|||||||
return $this->hasMany(Like::class);
|
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)
|
public function scopeWithLikes(Builder $query)
|
||||||
{
|
{
|
||||||
if (Auth::check()) {
|
if (Auth::check()) {
|
||||||
|
@ -70,6 +70,7 @@ SQL
|
|||||||
->select('ejaculations.*')
|
->select('ejaculations.*')
|
||||||
->with('user', 'tags')
|
->with('user', 'tags')
|
||||||
->withLikes()
|
->withLikes()
|
||||||
|
->onlyWebCheckin()
|
||||||
->take(21)
|
->take(21)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ class TimelineController extends Controller
|
|||||||
->select('ejaculations.*')
|
->select('ejaculations.*')
|
||||||
->with('user', 'tags')
|
->with('user', 'tags')
|
||||||
->withLikes()
|
->withLikes()
|
||||||
|
->onlyWebCheckin()
|
||||||
->paginate(21);
|
->paginate(21);
|
||||||
|
|
||||||
return view('timeline.public')->with(compact('ejaculations'));
|
return view('timeline.public')->with(compact('ejaculations'));
|
||||||
|
Loading…
Reference in New Issue
Block a user