This commit is contained in:
salam committed 2026-01-16 12:28:33 +01:00
1 parent 5273f0a3b4
commit 0e21bbe5f0
4 files changed
+123 -37

No files matched your search

+105 -24
View File
@@ -3,7 +3,13 @@
namespace App\Console\Commands\Grapper;
use App\Console\Commands\Curl;
use App\Console\Commands\Grapper\Fixtures\FindFixture;
use App\Console\Commands\Nuh;
use App\Models\Odds3way;
use App\Models\OddsDc;
use App\Models\OddsGgng;
use App\Models\OddsTotal;
use App\Utilities\Margin;
use App\Utilities\Notice;
class Betica
@@ -13,7 +19,7 @@ class Betica
$debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note(Nuh::$options['provider']['name'], 'g');
Notice::note(Nuh::$options['provider'], 'g');
}
/**
@@ -92,8 +98,6 @@ class Betica
foreach ($data['data'] as $row) {
print_r($row);
if (isset($row['parent_match_id']) && ! $row['is_esport']) {
$event = [
@@ -109,31 +113,108 @@ class Betica
'group_id' => (int) $row['competition_id'] ?? 0,
];
dd($event);
FindFixture::find($event);
FindFixture::search($event, self::$groups[$sport_id], self::$elements[$sport_id]);
if (isset($event['id'])) {
$base = [];
$base['sport_id'] = (int) Nuh::$options['sport_id'];
$base['provider_id'] = Nuh::$options['provider_id'];
$base['bmoid'] = (int) $row['match_id'];
$base['flag'] = 1;
foreach ($row['odds'] as $bettypes) {
switch ($bettypes['sub_type_id']) {
case 1:
// 1x2
$odds = [];
foreach ($bettypes['odds'] as $bettype) {
if ($bettype['outcome_id'] == 1) {
$odds['h3w'] = $bettype['odd_value'];
} elseif ($bettype['outcome_id'] == 2) {
$odds['d3w'] = $bettype['odd_value'];
} elseif ($bettype['outcome_id'] == 3) {
$odds['a3w'] = $bettype['odd_value'];
}
}
$odds['margin'] = (float) Margin::calculate($odds, 1);
$odds['starttime'] = (string) $row['start_time'];
Odds3way::updateOrCreate([
'event_id' => $event['id'],
'bookmaker_id' => Nuh::$options['bookmaker_id'],
], $base + $odds);
break;
case 10:
// DOUBLE CHANCE
$odds = [];
foreach ($bettypes['odds'] as $bettype) {
if ($bettype['outcome_id'] == 9) {
$odds['dc1x'] = $bettype['odd_value'];
} elseif ($bettype['outcome_id'] == 10) {
$odds['dc12'] = $bettype['odd_value'];
} elseif ($bettype['outcome_id'] == 11) {
$odds['dcx2'] = $bettype['odd_value'];
}
}
$odds['margin'] = (float) Margin::calculate($odds, 1);
OddsDc::updateOrCreate([
'event_id' => $event['id'],
'bookmaker_id' => Nuh::$options['bookmaker_id'],
], $base + $odds);
break;
case 18:
// TOTALS
$odds = [];
foreach ($bettypes['odds'] as $bettype) {
if ($bettype['outcome_id'] == 12 && $bettype['odd_key'] == 'over 2.5') {
$odds['over'] = $bettype['odd_value'];
} elseif ($bettype['outcome_id'] == 13 && $bettype['odd_key'] == 'over 2.5') {
$odds['under'] = $bettype['odd_value'];
}
}
$odds['margin'] = (float) Margin::calculate($odds, 1);
$odds['total'] = 2.5;
OddsTotal::updateOrCreate([
'event_id' => $event['id'],
'bookmaker_id' => Nuh::$options['bookmaker_id'],
], $base + $odds);
break;
case 29:
// BOTH TEAMS TO SCORE (GG/NG)
$odds = [];
foreach ($bettypes['odds'] as $bettype) {
if ($bettype['outcome_id'] == 74) {
$odds['gg'] = $bettype['odd_value'];
} elseif ($bettype['outcome_id'] == 76) {
$odds['ng'] = $bettype['odd_value'];
}
}
$odds['margin'] = (float) Margin::calculate($odds, 1);
OddsGgng::updateOrCreate([
'event_id' => $event['id'],
'bookmaker_id' => Nuh::$options['bookmaker_id'],
], $base + $odds);
break;
default:
dd($bettypes);
break;
}
}
}
}
// $bmoid = (int) $value['match_id'];
// $event = [];
// $event['status'] = 1;
// $event['bkmid'] = PARSER::$_config['bookmaker_id'];
// $event['bmoid'] = (int) $bmoid;
// $event['sportid'] = 1;
// $event['brmatchid'] = (int) $value['parent_match_id'];
// $event['starttime'] = strtotime($value['start_time']);
// $event['starttime'] -= 10800;
// $event['event'] = $value['home_team'].' v '.$value['away_team'];
// $event['groupname'] = $value['competition_name'];
// $event['groupid'] = $value['competition_id'];
// $event['country'] = $value['category'];
// $event['home'] = $value['home_team'];
// $event['away'] = $value['away_team'];
}
sleep(10);
}
}
}
}
@@ -90,7 +90,7 @@ class FindFixture
Event::where('id', $match->id)->update($update_array);
}
if (! in_array(Nuh::$options['provider_id'], [5, 6])) {
if (! in_array(Nuh::$options['provider_id'], [5, 6, 9])) {
StoreData::store($event, $match);
}
@@ -101,7 +101,7 @@ class FindFixture
return;
}
if (in_array(Nuh::$options['provider_id'], [5, 6])) {
if (in_array(Nuh::$options['provider_id'], [5, 6, 9])) {
Mapper::updateOrCreate(['event_id' => $event_id], $event);
return;
+4
View File
@@ -81,6 +81,10 @@ class Supervisorctl
// LOGIFUTURE COLOMBIA
$options['bookmaker_id'] = 36;
break;
case 9:
// BETICA
$options['bookmaker_id'] = 14;
break;
}
+12 -11
View File
@@ -14,18 +14,18 @@ class SupervisorSeeder extends Seeder
*/
$sql = "INSERT INTO `supervisors` (`id`, `name`, `provider_id`, `sport_id`, `txodds_market_id`, `sleep`, `limit`, `runtime`, `commandline_options`, `maxsconds`, `lastcall`, `use_lastcall`, `is_supervisor`, `is_active`, `days_from`, `days_to`, `created_at`, `updated_at`)
VALUES
(1, 'Fixtures', 1, NULL, NULL, 10, 0, '0.407', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-08-27 07:39:55', '2026-01-14 15:56:21'),
(2, 'Odds', 1, 1, NULL, 10, 0, '1.483', NULL, 30, 0, 0, 1, 1, 0, 10, '2025-12-01 05:41:02', '2026-01-14 16:36:54'),
(3, 'Fixtures', 2, 0, NULL, 15, 0, '0.133', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-19 11:42:35', '2026-01-14 15:56:02'),
(4, 'Willhill', 2, 0, NULL, 15, 0, '2.119', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-19 11:48:05', '2026-01-14 15:56:02'),
(5, 'Bwin', 2, 0, NULL, 15, 0, '0.084', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-22 06:41:18', '2026-01-14 15:56:02'),
(6, 'Bet365', 2, 0, NULL, 10, 0, '0', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:56:02'),
(1, 'Fixtures', 1, NULL, NULL, 10, 0, '0.125', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-08-27 07:39:55', '2026-01-16 09:30:48'),
(2, 'Odds', 1, 1, NULL, 10, 0, '2.997', NULL, 30, 0, 0, 1, 1, 0, 10, '2025-12-01 05:41:02', '2026-01-16 09:33:49'),
(3, 'Fixtures', 2, 0, NULL, 15, 0, '0.266', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-19 11:42:35', '2026-01-16 09:34:05'),
(4, 'Willhill', 2, 0, NULL, 15, 0, '0.842', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-19 11:48:05', '2026-01-16 09:34:57'),
(5, 'Bwin', 2, 0, NULL, 15, 0, '0.278', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-22 06:41:18', '2026-01-16 09:35:14'),
(6, 'Bet365', 2, 0, NULL, 10, 0, '2.339', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-16 09:37:35'),
(7, 'Betfair', 2, 0, NULL, 10, 0, '0', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:56:02'),
(8, 'Fixtures', 4, 1, NULL, 10, 0, '1.368', NULL, 30, 0, 0, 0, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:55:29'),
(9, 'Odds', 4, 0, NULL, 15, 0, NULL, NULL, 1800, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-14 15:55:29'),
(8, 'Fixtures', 4, 1, NULL, 10, 0, '1.097', NULL, 30, 0, 0, 0, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-16 10:36:29'),
(9, 'Odds', 4, 0, NULL, 15, 0, '0.032', NULL, 1800, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-16 10:57:56'),
(10, 'Fixtures', 3, 0, NULL, 10, 0, '1.368', NULL, 30, 0, 0, 0, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:55:25'),
(11, 'Odds', 3, 0, NULL, 15, 0, NULL, NULL, 1800, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-14 15:55:24'),
(12, 'Odds', 5, 1, NULL, 10, 0, '1.368', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:55:39'),
(12, 'Odds', 5, 1, NULL, 10, 0, '0.284', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-16 11:02:04'),
(13, 'Odds', 5, 3, NULL, 15, 0, NULL, NULL, 1800, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-14 15:55:39'),
(14, 'Odds', 5, 2, NULL, 10, 0, '1.368', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:55:39'),
(15, 'Odds', 5, 5, NULL, 15, 0, NULL, NULL, 1800, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-14 15:55:39'),
@@ -63,8 +63,9 @@ class SupervisorSeeder extends Seeder
(47, '', 8, 5, 1, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:41:00', '2026-01-14 17:41:19'),
(48, '', 8, 5, 3, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:41:05', '2026-01-14 17:41:21'),
(49, '', 8, 5, 4, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:41:11', '2026-01-14 17:41:23'),
(50, '', 8, 5, 131073, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:41:16', '2026-01-14 17:41:25');
";
(50, '', 8, 5, 131073, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:41:16', '2026-01-14 17:41:25'),
(51, '', 9, 1, NULL, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-16 12:05:14', '2026-01-16 12:05:14');
";
DB::unprepared($sql);
}
}