grapper wip
This commit is contained in:
1 parent
944aa736b2
commit
adb15e701b
9 files changed
+95
-68
No files matched your search
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\Commands\Grapper\TxOdds\TxOdds;
|
||||
use App\Models\Supervisor;
|
||||
use App\Utilities\Notice;
|
||||
use App\Utilities\Supervisorctl;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class NuhBash extends Command
|
||||
{
|
||||
public static $event = [];
|
||||
|
||||
public static $_send = [];
|
||||
|
||||
public static $sport_id = 0;
|
||||
|
||||
public static $options = [];
|
||||
|
||||
public static $force = 0;
|
||||
|
||||
public static $debug = 0;
|
||||
|
||||
public static $domain = '';
|
||||
|
||||
public static $auth = '';
|
||||
|
||||
protected $signature = 'nuh {process=help} {eventid=0} {--d} {--f} {--a} {--p} {--w}';
|
||||
|
||||
protected $description = 'NuhBash';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
self::$options = $this->options();
|
||||
|
||||
self::$options['supervisor_id'] = $this->argument('process');
|
||||
self::$options['event_id'] = $this->argument('eventid');
|
||||
|
||||
if ($this->argument('process') == 'help') {
|
||||
$txt = 'List of parameters'.PHP_EOL;
|
||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||
$txt .= 'process [id] (required)'.PHP_EOL;
|
||||
$txt .= 'eventid [id] (optional)'.PHP_EOL;
|
||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||
$txt .= 'List of options'.PHP_EOL;
|
||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||
$txt .= '--d debug'.PHP_EOL;
|
||||
$txt .= '--f force update market'.PHP_EOL;
|
||||
$txt .= '--a reload all'.PHP_EOL;
|
||||
$txt .= '--w reload one week'.PHP_EOL;
|
||||
$txt .= '--p print odds'.PHP_EOL;
|
||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||
$txt .= 'List of supervisors'.PHP_EOL;
|
||||
$txt .= '----------------------------------------------'.PHP_EOL;
|
||||
$tmp = Supervisor::all();
|
||||
foreach ($tmp as $value) {
|
||||
$txt .= $value->provider->name.' '.$value->id.' - '.$value->type.' '.$value->name.PHP_EOL;
|
||||
}
|
||||
Notice::note($txt, 'b', 1);
|
||||
}
|
||||
|
||||
Supervisorctl::start(self::$options);
|
||||
|
||||
Helper::get_auth_string();
|
||||
|
||||
switch (self::$options['provider_id']) {
|
||||
case 1:
|
||||
case 2:
|
||||
TxOdds::switch();
|
||||
break;
|
||||
case 3:
|
||||
// betsapi
|
||||
break;
|
||||
default:
|
||||
Note::notice('Provider not defined', 'r', 1);
|
||||
break;
|
||||
}
|
||||
|
||||
Supervisorctl::end(self::$options);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user