]> _ Git - psq.git/commitdiff
300sec emial batch + weekly agznda date
authorLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 14 Sep 2020 08:12:32 +0000 (10:12 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 14 Sep 2020 08:12:32 +0000 (10:12 +0200)
app/Http/Controllers/EnPlusController.php
app/Jobs/ProcessEmailBatch.php

index 4e3136ce335252f5c11b221a7c40a45b163b48dd..6a313a3ab0b59fed7a4129df41128db9902da6dd 100644 (file)
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
 
 use App\Models\Humeur;
 use App\Models\WeeklyAgenda;
+use Carbon\Carbon;
 use Illuminate\Http\Request;
 
 class EnPlusController extends Controller
@@ -12,7 +13,11 @@ class EnPlusController extends Controller
     public function index()
     {
         \View::share('humeur', Humeur::query()->orderByDesc('id')->firstOrFail());
-        \View::share('agenda', WeeklyAgenda::query()->orderByDesc('id')->firstOrFail());
+        $agenda = WeeklyAgenda::query()
+            ->orderBy('start_date')
+            ->where('start_date', '>=', now()->addDay()->startof('week'))
+            ->firstOrFail();
+        \View::share('agenda', $agenda);
         \View::share('title', "Agenda et Humeur");
 
         return view('en-plus.index');
index 00fca96d6fa6ff7170ae2c5c640c54b8981e77d2..eb3c4bd4477a5fb85f19ce8cf1b0757c49e4cebf 100644 (file)
@@ -30,6 +30,7 @@ class ProcessEmailBatch implements ShouldQueue
 
     private $users;
 
+    public $timeout = 300;
 
 
     /**