diff --git a/app/Http/Controllers/Bo/ReductionsController.php b/app/Http/Controllers/Bo/ReductionsController.php index 092ab503..0d4c1e86 100644 --- a/app/Http/Controllers/Bo/ReductionsController.php +++ b/app/Http/Controllers/Bo/ReductionsController.php @@ -12,7 +12,7 @@ use LDCWeb\MesBR; class ReductionsController extends Controller { public function index() { - $r = Reductions::all(); + $r = Reductions::where('end_date_broadcast', '>', Carbon::now())->get(); $ranges = Ranges::with('products')->get(); return view('bo.reductions.index', compact('r', 'ranges')); } diff --git a/app/Models/Products.php b/app/Models/Products.php index 0ebaf745..ac603f55 100644 --- a/app/Models/Products.php +++ b/app/Models/Products.php @@ -94,6 +94,6 @@ class Products extends Model public function reductions() { - return $this->belongsToMany(Reductions::class, 'reduction_config'); + return $this->belongsToMany(Reductions::class, 'reduction_config', 'product_id', 'reduction_id'); } } diff --git a/app/Models/Reductions.php b/app/Models/Reductions.php index f6024b9f..a9d8f5b1 100644 --- a/app/Models/Reductions.php +++ b/app/Models/Reductions.php @@ -8,7 +8,7 @@ class Reductions extends Model { public function products() { - return $this->belongsToMany(Products::class, 'reduction_config'); + return $this->belongsToMany(Products::class, 'reduction_config', 'reduction_id', 'product_id'); } public function ranges() diff --git a/database/migrations/2021_02_17_142244_create_jobs_table.php b/database/migrations/2021_02_17_142244_create_jobs_table.php new file mode 100644 index 00000000..1be9e8a8 --- /dev/null +++ b/database/migrations/2021_02_17_142244_create_jobs_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('jobs'); + } +} diff --git a/resources/views/layouts/app-footer.blade.php b/resources/views/layouts/app-footer.blade.php index 96ba5274..11524f54 100644 --- a/resources/views/layouts/app-footer.blade.php +++ b/resources/views/layouts/app-footer.blade.php @@ -4,7 +4,7 @@
- Logo - Le Gaulois + Logo - Le Gaulois