main book on top in comp wip
This commit is contained in:
1 parent
40d97327d4
commit
612a5444d3
18 files changed
+271
-34
No files matched your search
@@ -19,14 +19,24 @@ class Bet365
|
||||
public static function grap()
|
||||
{
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$break = Nuh::$options['b'] ?? 0;
|
||||
|
||||
$week = Nuh::$options['w'] ?? 0;
|
||||
|
||||
/**
|
||||
* Bet365
|
||||
*/
|
||||
$bookmaker_id = 126;
|
||||
|
||||
$events = Event::where('bet365_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(1)->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
if ($break) {
|
||||
$events = Event::where('bet365_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDay()->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
} elseif ($week) {
|
||||
$events = Event::where('bet365_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(7)->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
} else {
|
||||
// all
|
||||
$events = Event::where('bet365_id', '>', 0)->where('starttime', '>', Carbon::now()->toDateTimeString())->select('id', 'sport_id', 'bet365_id', 'starttime')->get();
|
||||
}
|
||||
|
||||
foreach ($events as $key => $event) {
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Console\Commands\Nuh;
|
||||
use App\Mapper\FindFixture;
|
||||
use App\Mapper\LoadElements;
|
||||
use App\Mapper\LoadGroups;
|
||||
use App\Models\Country;
|
||||
use App\Models\Mapper;
|
||||
use App\Models\Sport;
|
||||
use App\Utilities\Notice;
|
||||
@@ -37,7 +38,9 @@ class Fixtures
|
||||
|
||||
self::$groups = LoadGroups::load(Nuh::$options['provider_id']);
|
||||
|
||||
$sportmap = Sport::map('bapi');
|
||||
$country_map = Country::pluck('id', 'iso2');
|
||||
|
||||
$sportmap = Sport::map('bapi', 0, [1]);
|
||||
|
||||
$now = Carbon::now();
|
||||
|
||||
@@ -78,12 +81,14 @@ class Fixtures
|
||||
|
||||
if (isset($row['home']['id']) && isset($row['away']['id']) && strpos($row['league']['name'], 'Esoccer') === false) {
|
||||
|
||||
$cc = strtoupper($row['league']['cc']);
|
||||
$event = [
|
||||
'event_id' => (int) $row['id'],
|
||||
'bet365_id' => isset($row['bet365_id']) ? $row['bet365_id'] : 0,
|
||||
'sport_id' => (int) $sport_id,
|
||||
'provider_id' => (int) Nuh::$options['provider_id'],
|
||||
'starttime' => Carbon::createFromTimestamp((string) $row['time'])->toDateTimeString(),
|
||||
'country_id' => $cc != null ? $country_map[$cc] : 0,
|
||||
'home' => $row['home']['name'] ?? '',
|
||||
'home_id' => (int) $row['home']['id'],
|
||||
'home_cc' => strtoupper($row['home']['cc']) ?? '',
|
||||
|
||||
@@ -21,7 +21,7 @@ class Sport extends Model
|
||||
}
|
||||
} else {
|
||||
if ($limit) {
|
||||
return Sport::where('is_active', 1)->whereIn($limit, 'id')->pluck('id', $field)->toArray();
|
||||
return Sport::where('is_active', 1)->whereIn('id', $limit)->pluck($field, 'id')->toArray();
|
||||
} else {
|
||||
return Sport::where('is_active', 1)->pluck($field, 'id')->toArray();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user