diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_2Way.php b/app/Console/Commands/Grapper/TxOdds/Odds/_2Way.php index bff5c287..54847d9a 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_2Way.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_2Way.php @@ -2,6 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; +use App\Console\Commands\Nuh; use App\Models\Odds2way; use App\Utilities\Margin; @@ -9,6 +10,8 @@ class _2Way { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['h2w'] = (float) $value->o1; $odds['a2w'] = (float) $value->o3; @@ -19,7 +22,7 @@ class _2Way if (! $res) { Odds2way::create($odds); - } else { + } elseif (! $block_create) { $res->h2w = $odds['h2w']; $res->a2w = $odds['a2w']; $res->flags = 1; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_2WayS1.php b/app/Console/Commands/Grapper/TxOdds/Odds/_2WayS1.php index 9691edce..cbb315fd 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_2WayS1.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_2WayS1.php @@ -2,6 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; +use App\Console\Commands\Nuh; use App\Models\Odds2wayS1; use App\Utilities\Margin; @@ -9,6 +10,8 @@ class _2WayS1 { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['h2w'] = (float) $value->o1; $odds['a2w'] = (float) $value->o3; @@ -19,7 +22,7 @@ class _2WayS1 if (! $res) { Odds2wayS1::create($odds); - } else { + } elseif (! $block_create) { $res->h2w = $odds['h2w']; $res->a2w = $odds['a2w']; $res->flags = 1; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_3Way.php b/app/Console/Commands/Grapper/TxOdds/Odds/_3Way.php index 47771954..15c025c5 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_3Way.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_3Way.php @@ -2,6 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; +use App\Console\Commands\Nuh; use App\Models\Odds3way; use App\Utilities\Margin; @@ -9,6 +10,8 @@ class _3Way { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['h3w'] = (float) $value->o1; $odds['d3w'] = (float) $value->o2; @@ -20,7 +23,7 @@ class _3Way if (! $res) { Odds3way::create($odds); - } else { + } elseif (! $block_create) { $res->h3w = $odds['h3w']; $res->a3w = $odds['d3w']; $res->d3w = $odds['a3w']; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_3WayHt.php b/app/Console/Commands/Grapper/TxOdds/Odds/_3WayHt.php index 6bd5b1eb..a92b6cf7 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_3WayHt.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_3WayHt.php @@ -2,6 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; +use App\Console\Commands\Nuh; use App\Models\Odds3wayHt; use App\Utilities\Margin; @@ -9,6 +10,8 @@ class _3WayHt { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['h3w'] = (float) $value->o1; $odds['d3w'] = (float) $value->o2; @@ -20,7 +23,7 @@ class _3WayHt if (! $res) { Odds3wayHt::create($odds); - } else { + } elseif (! $block_create) { $res->h3w = $odds['h3w']; $res->d3w = $odds['d3w']; $res->d3w = $odds['a3w']; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Dc.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Dc.php index c32be4fa..97e737fa 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Dc.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Dc.php @@ -2,6 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; +use App\Console\Commands\Nuh; use App\Models\OddsDc; use App\Utilities\Margin; @@ -9,6 +10,8 @@ class _Dc { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['dc1x'] = (float) $value->o1; $odds['dc12'] = (float) $value->o2; @@ -20,7 +23,7 @@ class _Dc if (! $res) { OddsDc::create($odds); - } else { + } elseif (! $block_create) { $res->dc1x = $odds['dc1x']; $res->dc12 = $odds['dc12']; $res->dcx2 = $odds['dcx2']; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Dnb.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Dnb.php index e94779c4..44f77038 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Dnb.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Dnb.php @@ -2,6 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; +use App\Console\Commands\Nuh; use App\Models\OddsDnb; use App\Utilities\Margin; @@ -9,6 +10,8 @@ class _Dnb { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['dnb1'] = (float) $value->o1; $odds['dnb2'] = (float) $value->o3; @@ -19,7 +22,7 @@ class _Dnb if (! $res) { OddsDnb::create($odds); - } else { + } elseif (! $block_create) { $res->dnb1 = $odds['dnb1']; $res->dnb2 = $odds['dnb2']; $res->flags = 1; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Ggng.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Ggng.php index ae4f1fbe..7e34d08b 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Ggng.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Ggng.php @@ -2,6 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; +use App\Console\Commands\Nuh; use App\Models\OddsGgng; use App\Utilities\Margin; @@ -9,6 +10,8 @@ class _Ggng { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['gg'] = (float) $value->o1; $odds['ng'] = (float) $value->o3; @@ -19,7 +22,7 @@ class _Ggng if (! $res) { OddsGgng::create($odds); - } else { + } elseif (! $block_create) { $res->gg = $odds['gg']; $res->ng = $odds['ng']; $res->flags = 1; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Points.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Points.php index 96d24105..0443c322 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Points.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Points.php @@ -3,6 +3,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread; +use App\Console\Commands\Nuh; use App\Models\OddsPoint; use App\Utilities\Margin; @@ -10,6 +11,8 @@ class _Points { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['home'] = (float) $value->o1; $odds['away'] = (float) $value->o2; @@ -31,7 +34,7 @@ class _Points if (! $res) { OddsPoint::create($odds); - } else { + } elseif (! $block_create) { $res->home = $odds['home']; $res->away = $odds['away']; $res->flags = 1; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_PointsHt.php b/app/Console/Commands/Grapper/TxOdds/Odds/_PointsHt.php index 869b32f2..17ed118f 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_PointsHt.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_PointsHt.php @@ -3,6 +3,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread; +use App\Console\Commands\Nuh; use App\Models\OddsPointHt; use App\Utilities\Margin; @@ -10,6 +11,8 @@ class _PointsHt { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['home'] = (float) $value->o1; $odds['away'] = (float) $value->o2; @@ -31,7 +34,7 @@ class _PointsHt if (! $res) { OddsPointHt::create($odds); - } else { + } elseif (! $block_create) { $res->home = $odds['home']; $res->away = $odds['away']; $res->flags = 1; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_PointsQ1.php b/app/Console/Commands/Grapper/TxOdds/Odds/_PointsQ1.php index e5022c89..bd73a8eb 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_PointsQ1.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_PointsQ1.php @@ -3,6 +3,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread; +use App\Console\Commands\Nuh; use App\Models\OddsPointQ1; use App\Utilities\Margin; @@ -10,6 +11,8 @@ class _PointsQ1 { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['home'] = (float) $value->o1; $odds['away'] = (float) $value->o2; @@ -31,7 +34,7 @@ class _PointsQ1 if (! $res) { OddsPointQ1::create($odds); - } else { + } elseif (! $block_create) { $res->home = $odds['home']; $res->away = $odds['away']; $res->flags = 1; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Totals.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Totals.php index cf882aed..ac079f52 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Totals.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Totals.php @@ -3,6 +3,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread; +use App\Console\Commands\Nuh; use App\Models\OddsTotal; use App\Utilities\Margin; @@ -10,6 +11,8 @@ class _Totals { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['over'] = (float) $value->o1; $odds['under'] = (float) $value->o2; @@ -37,7 +40,7 @@ class _Totals if (! $res) { OddsTotal::create($odds); - } else { + } elseif (! $block_create) { $res->over = $odds['over']; $res->under = $odds['under']; $res->flags = 1; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_TotalsHt.php b/app/Console/Commands/Grapper/TxOdds/Odds/_TotalsHt.php index 4286ebab..c4f0b404 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_TotalsHt.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_TotalsHt.php @@ -3,6 +3,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread; +use App\Console\Commands\Nuh; use App\Models\OddsTotalHt; use App\Utilities\Margin; @@ -10,6 +11,8 @@ class _TotalsHt { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['over'] = (float) $value->o1; $odds['under'] = (float) $value->o2; @@ -37,7 +40,7 @@ class _TotalsHt if (! $res) { OddsTotalHt::create($odds); - } else { + } elseif (! $block_create) { $res->over = $odds['over']; $res->under = $odds['under']; $res->flags = 1; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_TotalsQ1.php b/app/Console/Commands/Grapper/TxOdds/Odds/_TotalsQ1.php index e3fe94c7..6a66d2b1 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_TotalsQ1.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_TotalsQ1.php @@ -3,6 +3,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; use App\Console\Commands\Grapper\TxOdds\Odds\Tools\ActiveSpread; +use App\Console\Commands\Nuh; use App\Models\OddsTotalQ1; use App\Utilities\Margin; @@ -10,6 +11,8 @@ class _TotalsQ1 { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['over'] = (float) $value->o1; $odds['under'] = (float) $value->o2; @@ -37,7 +40,7 @@ class _TotalsQ1 if (! $res) { OddsTotalQ1::create($odds); - } else { + } elseif (! $block_create) { $res->over = $odds['over']; $res->under = $odds['under']; $res->flags = 1; diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/_Tq.php b/app/Console/Commands/Grapper/TxOdds/Odds/_Tq.php index ca1f9c68..1591df7e 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds/_Tq.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds/_Tq.php @@ -2,6 +2,7 @@ namespace App\Console\Commands\Grapper\TxOdds\Odds; +use App\Console\Commands\Nuh; use App\Models\OddsTq; use App\Utilities\Margin; @@ -9,6 +10,8 @@ class _Tq { public static function grap($odds, $offer) { + $block_create = Nuh::$options['b'] ?? 0; + foreach ($offer as $value) { $odds['htq'] = (float) $value->o1; $odds['atq'] = (float) $value->o3; @@ -19,7 +22,7 @@ class _Tq if (! $res) { OddsTq::create($odds); - } else { + } elseif (! $block_create) { $res->htq = $odds['htq']; $res->atq = $odds['atq']; $res->flags = 1; diff --git a/app/Console/Commands/Nuh.php b/app/Console/Commands/Nuh.php index a1fd947a..5d643cf9 100644 --- a/app/Console/Commands/Nuh.php +++ b/app/Console/Commands/Nuh.php @@ -21,7 +21,7 @@ class Nuh extends Command public static $id = 0; - protected $signature = 'nuh {process=help} {--id=0} {--fn=} {--gid=} {--p} {--d} {--x} {--t} {--w} {--a} {--r} {--s} {--g} {--t} {--q} {--f}'; + protected $signature = 'nuh {process=help} {--id=0} {--fn=} {--gid=} {--p} {--d} {--x} {--t} {--w} {--a} {--r} {--s} {--g} {--t} {--q} {--f} {--b}'; public function handle() { @@ -47,6 +47,7 @@ class Nuh extends Command $txt .= '--x generate supervisors'.PHP_EOL; $txt .= '--t load today'.PHP_EOL; $txt .= '--a all by id'.PHP_EOL; + $txt .= '--b only create (reload all for txodds)'.PHP_EOL; $txt .= '--w laod this week (tx)'.PHP_EOL; $txt .= '--g by minor groups (tx)'.PHP_EOL; $txt .= '--r read data from file '.PHP_EOL;