wip fix
This commit is contained in:
1 parent
9bcd4432c6
commit
6f92f9e1d5
1209 files changed
+220940
No files matched your search
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Logifuture;
|
||||
|
||||
use App\Console\Commands\Grapper\Logifuture\Tools\FilterHandicap;
|
||||
use App\Console\Commands\Grapper\Logifuture\Tools\LogifutureStorePoints;
|
||||
use App\Console\Commands\Grapper\Logifuture\Tools\LogifutureStoreTotals;
|
||||
use App\Console\Commands\Nuh;
|
||||
|
||||
class Basketball
|
||||
{
|
||||
public static function get(&$event, $match)
|
||||
{
|
||||
$n_totals = [];
|
||||
$n_totals_qt = [];
|
||||
$n_points = [];
|
||||
$n_points_qt = [];
|
||||
|
||||
$c_totals = [];
|
||||
$c_totals_qt = [];
|
||||
$c_points = [];
|
||||
$c_points_qt = [];
|
||||
|
||||
foreach ($match['odds'] as $name => $value) {
|
||||
/*
|
||||
case 'B_1X2_1':
|
||||
$event['h3w'] = $value;
|
||||
break;
|
||||
case 'B_1X2_X':
|
||||
$event['d3w'] = $value;
|
||||
break;
|
||||
case 'B_1X2_2':
|
||||
$event['a3w'] = $value;
|
||||
break;
|
||||
|
||||
case 'B_12_1':
|
||||
$_bai_2way['h2w'] = $value;
|
||||
break;
|
||||
case 'B_12_2':
|
||||
$_bai_2way['a2w'] = $value;
|
||||
break;
|
||||
*/
|
||||
|
||||
if (strpos($name, '@') !== false) {
|
||||
$pos = strpos($name, '@');
|
||||
$market = substr($name, 0, $pos);
|
||||
|
||||
switch ($market) {
|
||||
// NIGERIA
|
||||
case 'B_OUN':
|
||||
$n_totals[$name] = number_format($value, 2);
|
||||
break;
|
||||
case 'B_1QOU':
|
||||
$n_totals_qt[$name] = number_format($value, 2);
|
||||
break;
|
||||
case 'B_H':
|
||||
$n_points[$name] = number_format($value, 2);
|
||||
break;
|
||||
case 'B_1QH':
|
||||
$n_points_qt[$name] = number_format($value, 2);
|
||||
break;
|
||||
|
||||
// COLOMBIA
|
||||
case 'B_OUHND':
|
||||
$c_totals[$name] = number_format($value, 2);
|
||||
break;
|
||||
case 'B_OUHND1P':
|
||||
$c_totals_qt[$name] = number_format($value, 2);
|
||||
break;
|
||||
case 'B_12HND':
|
||||
$c_points[$name] = number_format($value, 2);
|
||||
break;
|
||||
case 'B_12HND1P':
|
||||
$c_points_qt[$name] = number_format($value, 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$_spreads = [];
|
||||
// COLUMBIA
|
||||
if ($c_totals) {
|
||||
FilterHandicap::filter($_spreads['total'], 'B_OUHND@', $c_totals, ['over', 'under', 'total']);
|
||||
}
|
||||
if ($c_totals_qt) {
|
||||
FilterHandicap::filter($_spreads['total_qt'], 'B_OUHND1P@', $c_totals_qt, ['over', 'under', 'total']);
|
||||
}
|
||||
if ($c_points) {
|
||||
FilterHandicap::filter($_spreads['point'], 'B_12HND@', $c_points, ['hth1', 'hth2', 'hcap']);
|
||||
}
|
||||
if ($c_points_qt) {
|
||||
FilterHandicap::filter($_spreads['point_qt'], 'B_12HND1P@', $c_points_qt, ['hth1', 'hth2', 'hcap']);
|
||||
}
|
||||
|
||||
// NIGERIA
|
||||
if ($n_totals) {
|
||||
FilterHandicap::filter($_spreads['total'], 'B_OUN@', $n_totals, ['over', 'under', 'total']);
|
||||
}
|
||||
if ($n_totals_qt) {
|
||||
FilterHandicap::filter($_spreads['total_qt'], 'B_1QOU@', $n_totals_qt, ['over', 'under', 'total']);
|
||||
}
|
||||
if ($n_points) {
|
||||
FilterHandicap::filter($_spreads['point'], 'B_H@', $n_points, ['hth1', 'hth2', 'hcap']);
|
||||
}
|
||||
if ($n_points_qt) {
|
||||
FilterHandicap::filter($_spreads['point_qt'], 'B_1QH@', $n_points_qt, ['hth1', 'hth2', 'hcap']);
|
||||
}
|
||||
|
||||
$base = [];
|
||||
$base['event_id'] = $event['id'];
|
||||
$base['bookmaker_id'] = $event['bookmaker_id'];
|
||||
$base['sport_id'] = $event['sport_id'];
|
||||
$base['provider_id'] = Nuh::$options['provider_id'];
|
||||
$base['bmoid'] = $event['event_id'];
|
||||
$base['flags'] = 1;
|
||||
|
||||
if (isset($_spreads['total'])) {
|
||||
LogifutureStoreTotals::store($_spreads['total'], $base);
|
||||
}
|
||||
if (isset($_spreads['point'])) {
|
||||
LogifutureStorePoints::store($_spreads['point'], $base);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user