missing
This commit is contained in:
1 parent
ac6ce69989
commit
5389c75ea0
2 files changed
+65
No files matched your search
@@ -3,6 +3,7 @@
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\BettypeUser;
|
||||
use App\Models\EventBookmaker;
|
||||
use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -12,6 +13,12 @@ class BettypeToggle extends Component
|
||||
{
|
||||
public $bettype_toggles = [];
|
||||
|
||||
public $bookmakerCount = 0;
|
||||
|
||||
public $partnerCount = 0;
|
||||
|
||||
public $bookmakerPartnerDiffrences = 0;
|
||||
|
||||
protected $listeners = [
|
||||
'refreshBettypeMenu' => '$refresh',
|
||||
];
|
||||
@@ -20,6 +27,10 @@ class BettypeToggle extends Component
|
||||
{
|
||||
$this->bettype_toggles = [];
|
||||
|
||||
$this->countBookmaker();
|
||||
$this->countPartner();
|
||||
$this->setDifferences();
|
||||
|
||||
$res = BettypeUser::with('multiline_setting')
|
||||
->where('user_id', auth()->user()->id)
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
@@ -130,4 +141,19 @@ class BettypeToggle extends Component
|
||||
|
||||
$this->dispatch('refreshBettypeMenu');
|
||||
}
|
||||
|
||||
public function countBookmaker()
|
||||
{
|
||||
$this->bookmakerCount = EventBookmaker::where('bookmaker_id', auth()->user()->bookmaker_id)->count();
|
||||
}
|
||||
|
||||
public function countPartner()
|
||||
{
|
||||
$this->partnerCount = EventBookmaker::where('bookmaker_id', auth()->user()->partner_bookmaker_id)->count();
|
||||
}
|
||||
|
||||
public function setDifferences()
|
||||
{
|
||||
$this->bookmakerPartnerDiffrences = abs($this->bookmakerCount - $this->partnerCount);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,44 @@
|
||||
<div class="flex flex-row gap-2">
|
||||
|
||||
<x-filament::dropdown>
|
||||
<x-slot name="trigger">
|
||||
<x-filament::button size="xs" color="gray" wire:poll="setDifferences">
|
||||
Missing
|
||||
@if ($this->bookmakerPartnerDiffrences == 0)
|
||||
<x-filament::badge size="xs" color="gray">
|
||||
0
|
||||
</x-filament::badge>
|
||||
@else
|
||||
<x-filament::badge size="xs" color="danger">
|
||||
{{ $this->bookmakerPartnerDiffrences }}
|
||||
</x-filament::badge>
|
||||
@endif
|
||||
</x-filament::button>
|
||||
</x-slot>
|
||||
|
||||
<x-filament::dropdown.list>
|
||||
<x-filament::dropdown.list.item>
|
||||
<x-filament::badge size="xs" wire:poll="countBookmaker">
|
||||
{{ $this->bookmakerCount }}
|
||||
|
||||
</x-filament::badge>
|
||||
{{ auth()->user()->bookmaker->name }}
|
||||
</x-filament::dropdown.list.item>
|
||||
|
||||
<x-filament::dropdown.list.item>
|
||||
<x-filament::badge size="xs" wire:click="countPartner">
|
||||
{{ $this->partnerCount }}
|
||||
</x-filament::badge>
|
||||
{{ auth()->user()->partnerbookmaker->name }}
|
||||
</x-filament::dropdown.list.item>
|
||||
|
||||
</x-filament::dropdown.list>
|
||||
</x-filament::dropdown>
|
||||
|
||||
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
|
||||
<x-filament::button size="xs" tooltip="Today" wire:click="setToday" color="gray"
|
||||
icon="phosphor-calendar-dot-duotone" />
|
||||
|
||||
Reference in new issue
Block a user