diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php index 3fa2725..271a003 100644 --- a/app/Http/Controllers/SearchController.php +++ b/app/Http/Controllers/SearchController.php @@ -5,6 +5,7 @@ namespace App\Http\Controllers; use App\Ejaculation; use App\Tag; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Auth; class SearchController extends Controller { @@ -18,6 +19,12 @@ class SearchController extends Controller ->whereHas('tags', function ($query) use ($inputs) { $query->where('name', 'like', "%{$inputs['q']}%"); }) + ->whereHas('user', function ($query) { + $query->where('is_protected', false); + if (Auth::check()) { + $query->orWhere('id', Auth::id()); + } + }) ->where('is_private', false) ->orderBy('ejaculated_date', 'desc') ->with(['user', 'tags']) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index db289a8..1640c78 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -67,6 +67,8 @@ SQL abort(404); } + $dateUntil = now()->addMonth()->startOfMonth(); + $groupByDay = Ejaculation::select(DB::raw( <<<'SQL' to_char(ejaculated_date, 'YYYY/MM/DD') AS "date", @@ -74,6 +76,7 @@ count(*) AS "count" SQL )) ->where('user_id', $user->id) + ->where('ejaculated_date', '<', $dateUntil) ->groupBy(DB::raw("to_char(ejaculated_date, 'YYYY/MM/DD')")) ->orderBy(DB::raw("to_char(ejaculated_date, 'YYYY/MM/DD')")) ->get(); @@ -85,6 +88,7 @@ count(*) AS "count" SQL )) ->where('user_id', $user->id) + ->where('ejaculated_date', '<', $dateUntil) ->groupBy(DB::raw("to_char(ejaculated_date, 'HH24')")) ->orderBy(DB::raw('1')) ->get(); diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png index 059eb68..5cd54f6 100644 Binary files a/public/apple-touch-icon.png and b/public/apple-touch-icon.png differ diff --git a/public/chrome-touch-icon-192x192.png b/public/chrome-touch-icon-192x192.png index 7290ee0..14e94a5 100644 Binary files a/public/chrome-touch-icon-192x192.png and b/public/chrome-touch-icon-192x192.png differ diff --git a/public/manifest.json b/public/manifest.json index 96c8fe0..de37003 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -4,6 +4,7 @@ "description": "気持ちよくティッシュを使った、そのあとの感想戦。", "display": "minimal-ui", "start_url": "/", + "theme_color": "#e53fb1", "share_target": { "action": "/checkin", "method": "GET", diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 34128ce..5daf319 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -58,7 +58,7 @@