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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user