comparatore bookmaker odds wip

This commit is contained in:
salam committed 2025-12-12 16:30:00 +01:00
1 parent adaec7b3dc
commit 218c1e6e1c
59 files changed
+470 -129

No files matched your search

+5
View File
@@ -10,4 +10,9 @@ class Bettype extends Model
{
return $this->belongsTo(Sport::class);
}
public function matchpart()
{
return $this->belongsTo(Matchpart::class);
}
}
+10 -1
View File
@@ -52,6 +52,15 @@ class Event extends Model
public function odds_3way()
{
return $this->hasMany(Odds3way::class);
$_bookmaker = Multiline::where('sport_id', auth()->user()->sport_id)
->where('client_id', auth()->user()->client_id)
->where('bettype_id', 1)
->where('matchpart_id', 1)
->pluck('bookmaker_id');
return $this->hasMany(Odds3way::class, 'event_id', 'id')
->join('multilines', 'multilines.bookmaker_id', 'odds_3ways.bookmaker_id')
->orderBy('multilines.sort');
// return $this->hasMany(Odds3way::class, 'event_id', 'id')->whereIn('bookmaker_id', $_bookmaker);
}
}
+7
View File
@@ -0,0 +1,7 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Matchpart extends Model {}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Multiline extends Model
{
protected $fillable = [
'client_id',
'sport_id',
'bettype_id',
'matchpart_id',
'bookmaker_id',
'sort',
];
public function sport()
{
return $this->belongsTo(Sport::class);
}
public function matchpart()
{
return $this->belongsTo(Matchpart::class);
}
public function bettype()
{
return $this->belongsTo(Bettype::class);
}
public function bookmaker()
{
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ class Odds3way extends Model
public function bookmaker()
{
return $this->belongsTo(Bookmaker::class);
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
}
public function event()