Fix Reductions BO + Add migration Jobs table
This commit is contained in:
parent
31d0c12358
commit
6c8873e9e3
5 changed files with 40 additions and 4 deletions
|
|
@ -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'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
36
database/migrations/2021_02_17_142244_create_jobs_table.php
Normal file
36
database/migrations/2021_02_17_142244_create_jobs_table.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateJobsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('jobs', function (Blueprint $table) {
|
||||
$table->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');
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<div class="section-header">
|
||||
<a href="{{ route('home') }}">
|
||||
<picture>
|
||||
<img alt="Logo - Le Gaulois" src="{{ asset('images/logo-lgl-3f.svg') }}">
|
||||
<img alt="Logo - Le Gaulois" src="{{ asset('assets/images/logo-lgl-3f.svg') }}">
|
||||
</picture>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue