fix flags

This commit is contained in:
salam committed 2026-02-24 17:27:47 +01:00
1 parent 2cdc70f5a4
commit 7acb1375d4
11 files changed
+1035 -14

No files matched your search

+4
View File
@@ -2,6 +2,7 @@
namespace App\Console\Commands\Grapper; namespace App\Console\Commands\Grapper;
use App\Console\Commands\Grapper\TxOdds\Countries;
use App\Console\Commands\Grapper\TxOdds\Fixtures; use App\Console\Commands\Grapper\TxOdds\Fixtures;
use App\Console\Commands\Grapper\TxOdds\Odds; use App\Console\Commands\Grapper\TxOdds\Odds;
use App\Console\Commands\Nuh; use App\Console\Commands\Nuh;
@@ -14,6 +15,9 @@ class TxOdds
case 'Fixtures': case 'Fixtures':
Fixtures::grap(); Fixtures::grap();
break; break;
case 'Countries':
Countries::grap();
break;
default: default:
Odds::grap(); Odds::grap();
break; break;
@@ -2,25 +2,20 @@
namespace App\Console\Commands\Grapper\TxOdds; namespace App\Console\Commands\Grapper\TxOdds;
use App\Console\Commands\Curl;
use App\Console\Commands\Nuh; use App\Console\Commands\Nuh;
use App\Console\Commands\Xml;
use App\Models\Country; use App\Models\Country;
use App\Utilities\Notice; use App\Utilities\Notice;
class Countries class Countries
{ {
public static function call() public static function grap()
{ {
$debug = Nuh::$options['d'] ?? 0; $debug = Nuh::$options['d'] ?? 0;
$print = Nuh::$options['p'] ?? 0;
$url = 'https://xml2.txodds.com/feed/countries.php'; $url = 'https://xml2.txodds.com/feed/countries.php';
$data = Curl::load($url, $debug); $data = Xml::load($url);
if ($print) {
Notice::note($data, '', 1);
}
$count = 0; $count = 0;
foreach ($data as $row) { foreach ($data as $row) {
@@ -59,6 +59,7 @@ class SupervisorsTable
return [ return [
'Fixtures' => 'Fixtures', 'Fixtures' => 'Fixtures',
'Odds' => 'Odds', 'Odds' => 'Odds',
'Countries' => 'Countries',
]; ];
case 2: case 2:
return [ return [
+2
View File
@@ -27,6 +27,7 @@ class LoadEvents
$query = Event::query() $query = Event::query()
->with('home') ->with('home')
->with('away') ->with('away')
->where('has_markets', 1)
->where('sport_id', auth()->user()->sport_id) ->where('sport_id', auth()->user()->sport_id)
->where(function ($query) use ($element_ids) { ->where(function ($query) use ($element_ids) {
$query->orWhereIn('home_id', $element_ids)->orWhereIn('away_id', $element_ids); $query->orWhereIn('home_id', $element_ids)->orWhereIn('away_id', $element_ids);
@@ -35,6 +36,7 @@ class LoadEvents
$query = Event::query() $query = Event::query()
->with('home') ->with('home')
->with('away') ->with('away')
->where('has_markets', 1)
->where('sport_id', auth()->user()->sport_id); ->where('sport_id', auth()->user()->sport_id);
} }
@@ -5,7 +5,7 @@ namespace App\Livewire\Mapper;
use App\Models\Event; use App\Models\Event;
use App\Models\Mapper; use App\Models\Mapper;
class LoadProvider class LoadMapper
{ {
public static function load($search_values) public static function load($search_values)
{ {
@@ -30,6 +30,7 @@ class LoadProvider
} else { } else {
return Mapper::query() return Mapper::query()
->with('country_magloo')
->where('sport_id', auth()->user()->sport_id) ->where('sport_id', auth()->user()->sport_id)
->where('provider_id', auth()->user()->provider_id); ->where('provider_id', auth()->user()->provider_id);
} }
+9 -3
View File
@@ -3,7 +3,7 @@
namespace App\Livewire; namespace App\Livewire;
use App\Filament\Tables\Columns\MapperRightColumn; use App\Filament\Tables\Columns\MapperRightColumn;
use App\Livewire\Mapper\LoadProvider; use App\Livewire\Mapper\LoadMapper;
use App\Livewire\Mapper\SearchString; use App\Livewire\Mapper\SearchString;
use App\Livewire\Mapper\StoreMapped; use App\Livewire\Mapper\StoreMapped;
use App\Models\Country; use App\Models\Country;
@@ -65,7 +65,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
public function table(Table $table): Table public function table(Table $table): Table
{ {
return $table return $table
->query(LoadProvider::load($this->search_values)) ->query(LoadMapper::load($this->search_values))
->striped() ->striped()
->columns([ ->columns([
MapperRightColumn::make('left')->label('Event')->alignCenter(), MapperRightColumn::make('left')->label('Event')->alignCenter(),
@@ -84,7 +84,13 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
$this->dispatch('refreshMapperRight'); $this->dispatch('refreshMapperRight');
} }
}), }),
IconColumn::make('group_cc')->icon(fn (string $state): string => 'flag-country-'.$state)->label(''), IconColumn::make('country_magloo.icon')
->label('')
->icon(fn (string $state): string => $state)
->visible(fn () => in_array(auth()->user()->provider_id, [3, 4])),
IconColumn::make('group_cc')
->visible(fn () => auth()->user()->provider_id == 2)
->icon(fn (string $state): string => 'flag-country-'.$state)->label(''),
IconColumn::make('sport.icon') IconColumn::make('sport.icon')
->label('') ->label('')
->icon(fn ($record) => $record->sport->icon) ->icon(fn ($record) => $record->sport->icon)
+1
View File
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
class Country extends Model class Country extends Model
{ {
protected $fillable = [ protected $fillable = [
'id',
'name', 'name',
'icon', 'icon',
'iso2', 'iso2',
+1 -1
View File
@@ -40,7 +40,7 @@ class Event extends Model
public function country() public function country()
{ {
return $this->belongsTo(Country::class)->where('disabled', 0)->where('is_country', 1); return $this->belongsTo(Country::class)->where('disabled', 0);
} }
public function group() public function group()
+5
View File
@@ -32,6 +32,11 @@ class Mapper extends Model
return $this->belongsTo(Country::class, 'group_cc', 'iso2')->where('is_country', 1)->where('disabled', 0); return $this->belongsTo(Country::class, 'group_cc', 'iso2')->where('is_country', 1)->where('disabled', 0);
} }
public function country_magloo()
{
return $this->belongsTo(Country::class, 'country', 'name');
}
public function provider() public function provider()
{ {
return $this->belongsTo(Provider::class); return $this->belongsTo(Provider::class);
+2 -1
View File
@@ -71,7 +71,8 @@ class SupervisorSeeder extends Seeder
(56, 'Notify Alarms', 7, NULL, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-27 11:25:56', '2026-01-27 11:26:05'), (56, 'Notify Alarms', 7, NULL, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-27 11:25:56', '2026-01-27 11:26:05'),
(57, 'Bet365', 2, 3, NULL, 30, 0, '0.795', NULL, 30, 0, 0, 1, 1, 10, 10, '2026-02-19 12:47:50', '2026-02-24 14:33:22'), (57, 'Bet365', 2, 3, NULL, 30, 0, '0.795', NULL, 30, 0, 0, 1, 1, 10, 10, '2026-02-19 12:47:50', '2026-02-24 14:33:22'),
(58, 'Bet365', 2, 5, NULL, 30, 0, '1.665', NULL, 30, 0, 0, 1, 1, 10, 10, '2026-02-19 12:48:06', '2026-02-24 14:33:00'), (58, 'Bet365', 2, 5, NULL, 30, 0, '1.665', NULL, 30, 0, 0, 1, 1, 10, 10, '2026-02-19 12:48:06', '2026-02-24 14:33:00'),
(59, 'Bet365', 11, NULL, NULL, 60, 0, '1.531', NULL, 30, 0, 0, 1, 1, 0, 10, '2026-02-19 13:31:24', '2026-02-24 14:33:26'); (59, 'Bet365', 11, NULL, NULL, 60, 0, '1.531', NULL, 30, 0, 0, 1, 1, 0, 10, '2026-02-19 13:31:24', '2026-02-24 14:33:26'),
(60, 'Countries', 1, NULL, NULL, 30, 0, '0.008', NULL, 30, 0, 0, 0, 0, 10, 10, '2026-02-24 17:13:21', '2026-02-24 17:18:35');
"; ";
DB::unprepared($sql); DB::unprepared($sql);
} }
File diff suppressed because it is too large. Load diff