db wip
This commit is contained in:
1 parent
f8350fd319
commit
9d2a8ce628
25 files changed
+21
-33
No files matched your search
@@ -25,7 +25,7 @@ class Countries
|
|||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($data as $row) {
|
foreach ($data as $row) {
|
||||||
Country::updateOrCreate(
|
Country::updateOrCreate(
|
||||||
['txid' => (int) $row->id],
|
['id' => (int) $row->id],
|
||||||
['name' => (string) $row->name, 'cc' => (string) $row->cc]
|
['name' => (string) $row->name, 'cc' => (string) $row->cc]
|
||||||
);
|
);
|
||||||
$count++;
|
$count++;
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ class BookmakerForm
|
|||||||
TextInput::make('baid')
|
TextInput::make('baid')
|
||||||
->numeric()
|
->numeric()
|
||||||
->default(0),
|
->default(0),
|
||||||
TextInput::make('txid')
|
|
||||||
->numeric()
|
|
||||||
->default(0),
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,10 +23,6 @@ class BookmakersTable
|
|||||||
->label('BAID')
|
->label('BAID')
|
||||||
->numeric()
|
->numeric()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
TextColumn::make('txid')
|
|
||||||
->label('TXID')
|
|
||||||
->numeric()
|
|
||||||
->sortable(),
|
|
||||||
ToggleColumn::make('txso')->offColor('gray'),
|
ToggleColumn::make('txso')->offColor('gray'),
|
||||||
ToggleColumn::make('txot')->offColor('gray'),
|
ToggleColumn::make('txot')->offColor('gray'),
|
||||||
ToggleColumn::make('betsapi')->offColor('gray'),
|
ToggleColumn::make('betsapi')->offColor('gray'),
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ class CountryResource extends Resource
|
|||||||
TextInput::make('iso3')->maxLength(3),
|
TextInput::make('iso3')->maxLength(3),
|
||||||
TextInput::make('cc'),
|
TextInput::make('cc'),
|
||||||
TextInput::make('numeric'),
|
TextInput::make('numeric'),
|
||||||
TextInput::make('txid'),
|
|
||||||
Toggle::make('is_country'),
|
Toggle::make('is_country'),
|
||||||
Toggle::make('disabled')->label('Disable')->aboveLabel(['Hide in this table']),
|
Toggle::make('disabled')->label('Disable')->aboveLabel(['Hide in this table']),
|
||||||
]);
|
]);
|
||||||
@@ -67,7 +66,6 @@ class CountryResource extends Resource
|
|||||||
TextColumn::make('iso3'),
|
TextColumn::make('iso3'),
|
||||||
TextColumn::make('cc'),
|
TextColumn::make('cc'),
|
||||||
TextColumn::make('numeric'),
|
TextColumn::make('numeric'),
|
||||||
TextColumn::make('txid')->searchable(),
|
|
||||||
IconColumn::make('is_country')->alignCenter()->boolean(),
|
IconColumn::make('is_country')->alignCenter()->boolean(),
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ class EventsTable
|
|||||||
->options(function () {
|
->options(function () {
|
||||||
$res = Event::query()->where('starttime', '>', Carbon::now())->groupBy('country_id')->pluck('country_id')->toArray();
|
$res = Event::query()->where('starttime', '>', Carbon::now())->groupBy('country_id')->pluck('country_id')->toArray();
|
||||||
|
|
||||||
return Country::query()->whereIn('tx_id', $res)->pluck('name', 'tx_id');
|
return Country::query()->whereIn('id', $res)->pluck('name', 'id');
|
||||||
})
|
})
|
||||||
->live()
|
->live()
|
||||||
->reactive()
|
->reactive()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class ProvidersTable
|
|||||||
return $table
|
return $table
|
||||||
->striped()
|
->striped()
|
||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('id'),
|
TextColumn::make('id')->alignCenter()->badge(),
|
||||||
TextColumn::make('name'),
|
TextColumn::make('name'),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
|
|||||||
->options(function () {
|
->options(function () {
|
||||||
$res = Event::query()->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->groupBy('country_id')->pluck('country_id')->toArray();
|
$res = Event::query()->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->groupBy('country_id')->pluck('country_id')->toArray();
|
||||||
|
|
||||||
return Country::query()->whereIn('tx_id', $res)->pluck('name', 'tx_id');
|
return Country::query()->whereIn('id', $res)->pluck('name', 'id');
|
||||||
})
|
})
|
||||||
->live()
|
->live()
|
||||||
->reactive()
|
->reactive()
|
||||||
|
|||||||
@@ -58,14 +58,13 @@ class MultilineBookmaker extends Component implements HasActions, HasSchemas, Ha
|
|||||||
->label('Bookmaker')
|
->label('Bookmaker')
|
||||||
->width('2rem')
|
->width('2rem')
|
||||||
->options(function () {
|
->options(function () {
|
||||||
$books = Bookmaker::where('is_active', 1)->orderBy('txid')->pluck('name', 'txid');
|
$books = Bookmaker::where('is_active', 1)->orderBy('name')->pluck('name', 'id');
|
||||||
foreach ($books as $key => $value) {
|
foreach ($books as $key => $value) {
|
||||||
$books[$key] = $key.' - '.$value;
|
$books[$key] = $key.' - '.$value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $books;
|
return $books;
|
||||||
}),
|
}),
|
||||||
// ->options(Bookmaker::where('is_active', 1)->pluck('name', 'txid')),
|
|
||||||
])
|
])
|
||||||
->defaultSort('sort')
|
->defaultSort('sort')
|
||||||
->deferFilters(false)
|
->deferFilters(false)
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ class Bookmaker extends Model
|
|||||||
'icon',
|
'icon',
|
||||||
'image',
|
'image',
|
||||||
'baid',
|
'baid',
|
||||||
'txid',
|
|
||||||
'txso',
|
'txso',
|
||||||
'txot',
|
'txot',
|
||||||
'betsapi',
|
'betsapi',
|
||||||
|
|||||||
@@ -20,6 +20,6 @@ class CompetitionGroup extends Model
|
|||||||
|
|
||||||
public function country()
|
public function country()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Country::class, 'country_id', 'tx_id')->where('disabled', 0)->where('is_country', 1);
|
return $this->belongsTo(Country::class)->where('disabled', 0)->where('is_country', 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,6 @@ class Country extends Model
|
|||||||
'iso2',
|
'iso2',
|
||||||
'iso3',
|
'iso3',
|
||||||
'cc',
|
'cc',
|
||||||
'txid',
|
|
||||||
'is_country',
|
'is_country',
|
||||||
'disabled',
|
'disabled',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class MultilineClient extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function booted(): void
|
protected static function booted(): void
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Odds2way extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Odds2wayS1 extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class Odds3way extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provider()
|
public function provider()
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class OddsDc extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class OddsDnb extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class OddsGgng extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class OddsHandicap extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class OddsHandicapQ1 extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class OddsQualify extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class OddsTotal extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class OddsTotalQ1 extends Model
|
|||||||
|
|
||||||
public function bookmaker()
|
public function bookmaker()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Bookmaker::class, 'bookmaker_id', 'txid');
|
return $this->belongsTo(Bookmaker::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
|
|||||||
+1
-1
@@ -169,6 +169,6 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication
|
|||||||
|
|
||||||
public function userBookmaker()
|
public function userBookmaker()
|
||||||
{
|
{
|
||||||
return Bookmaker::where('id', auth()->user()->bookmaker_id)->select('id', 'name', 'icon', 'svg', 'txid')->first();
|
return Bookmaker::where('id', auth()->user()->bookmaker_id)->select('id', 'name', 'icon', 'svg')->first();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,8 +14,8 @@ class ClientsSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
$sql = "INSERT INTO `clients` (`id`, `name`, `homepage`, `bookmaker`, `provider`, `sport`, `created_at`, `updated_at`)
|
$sql = "INSERT INTO `clients` (`id`, `name`, `homepage`, `bookmaker`, `provider`, `sport`, `created_at`, `updated_at`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 'Magloo', NULL, '[20,24]', '[3,4]', '[1,3]', '2025-08-24 05:56:41', '2025-12-30 07:42:58'),
|
(1, 'Magloo', NULL, '[10,16]', '[3,4]', '[1,3]', '2025-08-24 05:56:41', '2025-12-30 07:42:58'),
|
||||||
(2, 'Logifuture', NULL, '[26,27]', '[5,6]', '[1,2,3,5]', '2025-08-24 05:57:01', '2025-12-30 07:43:26');
|
(2, 'Logifuture', NULL, '[35,36]', '[5,6]', '[1,2,3,5]', '2025-08-24 05:57:01', '2025-12-30 07:43:26');
|
||||||
";
|
";
|
||||||
DB::unprepared($sql);
|
DB::unprepared($sql);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user