partner programm completed
This commit is contained in:
1 parent
84bfa248cd
commit
a883ccf0ea
22 files changed
+722
-28
No files matched your search
@@ -3,6 +3,7 @@
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use App\Filament\Resources\Events\Tables\EventsTable;
|
||||
use App\Models\Bookmaker;
|
||||
use Filament\Tables\Columns\Column;
|
||||
|
||||
class ColumnOdds extends Column
|
||||
@@ -29,6 +30,10 @@ class ColumnOdds extends Column
|
||||
|
||||
public $compare;
|
||||
|
||||
public $partner;
|
||||
|
||||
public $partner_icon;
|
||||
|
||||
protected ?array $odds_labels;
|
||||
|
||||
protected bool $state = true;
|
||||
@@ -43,6 +48,8 @@ class ColumnOdds extends Column
|
||||
return;
|
||||
}
|
||||
|
||||
$this->setPartnerIcon();
|
||||
|
||||
$this->setSlots();
|
||||
|
||||
$this->has_data = count($this->data);
|
||||
@@ -81,6 +88,11 @@ class ColumnOdds extends Column
|
||||
return $this->columns;
|
||||
}
|
||||
|
||||
public function getPartnerBookmakerIcon()
|
||||
{
|
||||
return $this->partner_icon;
|
||||
}
|
||||
|
||||
public function getSlots()
|
||||
{
|
||||
if (auth()->user()->is_multiline_direct) {
|
||||
@@ -105,6 +117,11 @@ class ColumnOdds extends Column
|
||||
return $this->compare;
|
||||
}
|
||||
|
||||
public function getPartner()
|
||||
{
|
||||
return $this->partner;
|
||||
}
|
||||
|
||||
public function getMax()
|
||||
{
|
||||
return $this->max;
|
||||
@@ -118,76 +135,91 @@ class ColumnOdds extends Column
|
||||
public function getData($record)
|
||||
{
|
||||
$this->client = null;
|
||||
$this->partner = null;
|
||||
$this->data = null;
|
||||
switch ($this->bettype) {
|
||||
case 'odds_2ways':
|
||||
$this->data = $record->odds_2ways;
|
||||
$this->client = $record->odds_2ways->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_2ways->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_2ways_s1':
|
||||
$this->data = $record->odds_2ways_s1;
|
||||
$this->client = $record->odds_2ways_s1->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_2ways_s1->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_3ways':
|
||||
$this->data = $record->odds_3ways;
|
||||
$this->client = $record->odds_3ways->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_3ways->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_3ways_ht':
|
||||
$this->data = $record->odds_3ways_ht;
|
||||
$this->client = $record->odds_3ways_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_3ways_ht->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_dc':
|
||||
$this->data = $record->odds_dc;
|
||||
$this->client = $record->odds_dc->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_dc->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_dnb':
|
||||
$this->data = $record->odds_dnb;
|
||||
$this->client = $record->odds_dnb->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_dnb->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_ggng':
|
||||
$this->data = $record->odds_ggng;
|
||||
$this->client = $record->odds_ggng->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_ggng->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_points':
|
||||
$this->data = $record->odds_points;
|
||||
$this->client = $record->odds_points->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_points->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_points_ht':
|
||||
$this->data = $record->odds_points_ht;
|
||||
$this->client = $record->odds_points_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_points_ht->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_points_q1':
|
||||
$this->data = $record->odds_points_q1;
|
||||
$this->client = $record->odds_points_q1->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_points_q1->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_totals':
|
||||
$this->data = $record->odds_totals;
|
||||
$this->client = $record->odds_totals->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_totals->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_totals_ht':
|
||||
$this->data = $record->odds_totals_ht;
|
||||
$this->client = $record->odds_totals_ht->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_totals_ht->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_totals_q1':
|
||||
$this->data = $record->odds_totals_q1;
|
||||
$this->client = $record->odds_totals_q1->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_totals_q1->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
case 'odds_tq':
|
||||
$this->data = $record->odds_tq;
|
||||
$this->client = $record->odds_tq->where('bookmaker_id', auth()->user()->bookmaker_id)->first();
|
||||
$this->partner = $record->odds_tq->where('bookmaker_id', auth()->user()->partner_bookmaker_id)->first();
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -342,6 +374,11 @@ class ColumnOdds extends Column
|
||||
});
|
||||
}
|
||||
|
||||
public function setPartnerIcon()
|
||||
{
|
||||
$this->partner_icon = Bookmaker::where('id', auth()->user()->partner_bookmaker_id)->value('icon');
|
||||
}
|
||||
|
||||
public function setSlots()
|
||||
{
|
||||
$this->slots = EventsTable::$slots[$this->bettype];
|
||||
|
||||
Reference in new issue
Block a user