make Bet365All

This commit is contained in:
salam committed 2026-02-19 15:19:15 +01:00
1 parent e93b62efdf
commit c111225085
7 files changed
+344 -10

No files matched your search

@@ -0,0 +1,86 @@
<?php
namespace App\Console\Commands\DbMapper;
use App\Console\Commands\DbMapper\Helper\FindElement;
use App\Console\Commands\DbMapper\Helper\FindGroup;
use App\Console\Commands\DbMapper\Store\StoreElement;
use App\Console\Commands\DbMapper\Store\StoreGroup;
use App\Console\Commands\Nuh;
use App\Models\Event;
use App\Models\Mapper;
use App\Models\Sport;
use App\Utilities\Notice;
use Carbon\Carbon;
class Bet365All
{
/**
* Provider ID 2
*/
public static function run()
{
$debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note(Nuh::$options['name'], 'g');
}
$sports = Sport::getActiveSports();
foreach ($sports as $sport_id) {
$mappers = Mapper::where('provider_id', 2)->where('sport_id', $sport_id)->where('starttime', '>', Carbon::now())->get()->toArray();
foreach ($mappers as $mapper) {
FindElement::run($mapper);
FindGroup::run($mapper);
if ($debug) {
Notice::note($mapper, 'b');
}
if ($mapper['txodds_home_id'] && $mapper['txodds_away_id'] && $mapper['txodds_group_id']) {
$from = Carbon::createFromDate($mapper['starttime'])->subDay();
$to = Carbon::createFromDate($mapper['starttime'])->addDay();
$event = Event::whereDate('starttime', '>', $from)
->whereDate('starttime', '<', $to)
->where('home_id', $mapper['txodds_home_id'])
->where('away_id', $mapper['txodds_away_id'])
->where('competition_group_id', $mapper['txodds_group_id'])
->first();
if ($event) {
StoreElement::store($mapper);
StoreGroup::store($mapper);
$arr = [];
if ($mapper['bet365_id']) {
$arr['bet365_id'] = $mapper['bet365_id'];
}
if ($mapper['betradar_id']) {
$arr['betradar_id'] = $mapper['betradar_id'];
}
if ($mapper['betsapi_id']) {
$arr['betsapi_id'] = $mapper['betsapi_id'];
}
if ($arr) {
Event::where('id', $event->id)->update($arr);
Mapper::where('id', $mapper['id'])->delete();
}
if ($debug) {
Notice::note($event->toArray(), 'g');
}
}
}
}
}
}
}
+13 -9
View File
@@ -13,15 +13,19 @@ class DbMapper
switch (Nuh::$options['name']) {
case 'Bet365':
switch (Nuh::$options['sport']) {
case 'Tennis':
Bet365Tennis::run();
break;
default:
Notice::note(Nuh::$options['name'].' '.Nuh::$options['sport'].' not implemented', 'r', 1);
break;
}
Bet365All::run();
break;
case 'MAGLOO KENIA':
MaglooKeniaAll::run();
break;
case 'MAGLOO NIGERIA':
MaglooNigeriaAll::run();
break;
case 'LOGIFUTURE NIGERA':
LogifutureNigeriaAll::run();
break;
case 'LOGIFUTURE COLOMBIA':
LogifutureColombiaAll::run();
break;
default:
@@ -0,0 +1,80 @@
<?php
namespace App\Console\Commands\DbMapper;
use App\Console\Commands\DbMapper\Helper\FindElement;
use App\Console\Commands\DbMapper\Helper\FindGroup;
use App\Console\Commands\DbMapper\Store\StoreElement;
use App\Console\Commands\DbMapper\Store\StoreGroup;
use App\Console\Commands\Nuh;
use App\Models\Event;
use App\Models\Mapper;
use App\Utilities\Notice;
use Carbon\Carbon;
class LogifutureColombiaAll
{
/**
* Provider ID 2
*/
public static function run()
{
$debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note(Nuh::$options['name'].' '.Nuh::$options['sport'], 'g');
}
$mappers = Mapper::where('provider_id', 2)->where('sport_id', 5)->where('starttime', '>', Carbon::now())->get()->toArray();
foreach ($mappers as $mapper) {
FindElement::run($mapper);
FindGroup::run($mapper);
if ($debug) {
Notice::note($mapper, 'b');
}
if ($mapper['txodds_home_id'] && $mapper['txodds_away_id'] && $mapper['txodds_group_id']) {
$from = Carbon::createFromDate($mapper['starttime'])->subDay();
$to = Carbon::createFromDate($mapper['starttime'])->addDay();
$event = Event::whereDate('starttime', '>', $from)
->whereDate('starttime', '<', $to)
->where('home_id', $mapper['txodds_home_id'])
->where('away_id', $mapper['txodds_away_id'])
->where('competition_group_id', $mapper['txodds_group_id'])
->first();
if ($event) {
StoreElement::store($mapper);
StoreGroup::store($mapper);
$arr = [];
if ($mapper['bet365_id']) {
$arr['bet365_id'] = $mapper['bet365_id'];
}
if ($mapper['betradar_id']) {
$arr['betradar_id'] = $mapper['betradar_id'];
}
if ($mapper['betsapi_id']) {
$arr['betsapi_id'] = $mapper['betsapi_id'];
}
if ($arr) {
Event::where('id', $event->id)->update($arr);
Mapper::where('id', $mapper['id'])->delete();
}
if ($debug) {
Notice::note($event->toArray(), 'g');
}
}
}
}
}
}
@@ -0,0 +1,80 @@
<?php
namespace App\Console\Commands\DbMapper;
use App\Console\Commands\DbMapper\Helper\FindElement;
use App\Console\Commands\DbMapper\Helper\FindGroup;
use App\Console\Commands\DbMapper\Store\StoreElement;
use App\Console\Commands\DbMapper\Store\StoreGroup;
use App\Console\Commands\Nuh;
use App\Models\Event;
use App\Models\Mapper;
use App\Utilities\Notice;
use Carbon\Carbon;
class LogifutureNigeriaAll
{
/**
* Provider ID 2
*/
public static function run()
{
$debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note(Nuh::$options['name'].' '.Nuh::$options['sport'], 'g');
}
$mappers = Mapper::where('provider_id', 2)->where('sport_id', 5)->where('starttime', '>', Carbon::now())->get()->toArray();
foreach ($mappers as $mapper) {
FindElement::run($mapper);
FindGroup::run($mapper);
if ($debug) {
Notice::note($mapper, 'b');
}
if ($mapper['txodds_home_id'] && $mapper['txodds_away_id'] && $mapper['txodds_group_id']) {
$from = Carbon::createFromDate($mapper['starttime'])->subDay();
$to = Carbon::createFromDate($mapper['starttime'])->addDay();
$event = Event::whereDate('starttime', '>', $from)
->whereDate('starttime', '<', $to)
->where('home_id', $mapper['txodds_home_id'])
->where('away_id', $mapper['txodds_away_id'])
->where('competition_group_id', $mapper['txodds_group_id'])
->first();
if ($event) {
StoreElement::store($mapper);
StoreGroup::store($mapper);
$arr = [];
if ($mapper['bet365_id']) {
$arr['bet365_id'] = $mapper['bet365_id'];
}
if ($mapper['betradar_id']) {
$arr['betradar_id'] = $mapper['betradar_id'];
}
if ($mapper['betsapi_id']) {
$arr['betsapi_id'] = $mapper['betsapi_id'];
}
if ($arr) {
Event::where('id', $event->id)->update($arr);
Mapper::where('id', $mapper['id'])->delete();
}
if ($debug) {
Notice::note($event->toArray(), 'g');
}
}
}
}
}
}
@@ -12,7 +12,7 @@ use App\Models\Mapper;
use App\Utilities\Notice;
use Carbon\Carbon;
class Bet365Tennis
class MaglooKeniaAll
{
/**
* Provider ID 2
@@ -0,0 +1,80 @@
<?php
namespace App\Console\Commands\DbMapper;
use App\Console\Commands\DbMapper\Helper\FindElement;
use App\Console\Commands\DbMapper\Helper\FindGroup;
use App\Console\Commands\DbMapper\Store\StoreElement;
use App\Console\Commands\DbMapper\Store\StoreGroup;
use App\Console\Commands\Nuh;
use App\Models\Event;
use App\Models\Mapper;
use App\Utilities\Notice;
use Carbon\Carbon;
class MaglooNigeriaAll
{
/**
* Provider ID 2
*/
public static function run()
{
$debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note(Nuh::$options['name'].' '.Nuh::$options['sport'], 'g');
}
$mappers = Mapper::where('provider_id', 2)->where('sport_id', 5)->where('starttime', '>', Carbon::now())->get()->toArray();
foreach ($mappers as $mapper) {
FindElement::run($mapper);
FindGroup::run($mapper);
if ($debug) {
Notice::note($mapper, 'b');
}
if ($mapper['txodds_home_id'] && $mapper['txodds_away_id'] && $mapper['txodds_group_id']) {
$from = Carbon::createFromDate($mapper['starttime'])->subDay();
$to = Carbon::createFromDate($mapper['starttime'])->addDay();
$event = Event::whereDate('starttime', '>', $from)
->whereDate('starttime', '<', $to)
->where('home_id', $mapper['txodds_home_id'])
->where('away_id', $mapper['txodds_away_id'])
->where('competition_group_id', $mapper['txodds_group_id'])
->first();
if ($event) {
StoreElement::store($mapper);
StoreGroup::store($mapper);
$arr = [];
if ($mapper['bet365_id']) {
$arr['bet365_id'] = $mapper['bet365_id'];
}
if ($mapper['betradar_id']) {
$arr['betradar_id'] = $mapper['betradar_id'];
}
if ($mapper['betsapi_id']) {
$arr['betsapi_id'] = $mapper['betsapi_id'];
}
if ($arr) {
Event::where('id', $event->id)->update($arr);
Mapper::where('id', $mapper['id'])->delete();
}
if ($debug) {
Notice::note($event->toArray(), 'g');
}
}
}
}
}
}
@@ -89,6 +89,10 @@ class SupervisorsTable
case 11:
return [
'Bet365' => 'Bet365',
'MAGLOO KENIA' => 'MAGLOO KENIA',
'MAGLOO NIGERIA' => 'MAGLOO NIGERIA',
'LOGIFUTURE NIGERA' => 'LOGIFUTURE NIGERA',
'LOGIFUTURE COLOMBIA' => 'LOGIFUTURE COLOMBIA',
];
default:
return [];