58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Odds3way extends Model
|
|
{
|
|
protected $table = 'odds_3ways';
|
|
|
|
protected $casts = [
|
|
'h3w' => 'float',
|
|
'd3w' => 'float',
|
|
'a3w' => 'float',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'id',
|
|
'event_id',
|
|
'sport_id',
|
|
'bookmaker_id',
|
|
'provider_id',
|
|
'offer_id',
|
|
'bmoid',
|
|
'h3w',
|
|
'd3w',
|
|
'a3w',
|
|
'margin',
|
|
'flags',
|
|
'nuh_check',
|
|
];
|
|
|
|
public function comparing_bookmaker()
|
|
{
|
|
return $this->hasOne(ComparingBookmaker::class, 'bookmaker_id', 'bookmaker_id')->where('comparing_bookmakers.sport_id', auth()->user()->sport_id);
|
|
}
|
|
|
|
public function event()
|
|
{
|
|
return $this->belongsTo(Event::class);
|
|
}
|
|
|
|
public function sport()
|
|
{
|
|
return $this->belongsTo(Sport::class);
|
|
}
|
|
|
|
public function bookmaker()
|
|
{
|
|
return $this->belongsTo(Bookmaker::class);
|
|
}
|
|
|
|
public function provider()
|
|
{
|
|
return $this->belongsTo(Provider::class);
|
|
}
|
|
}
|