mapper MaglooNigeriaAll add
This commit is contained in:
1 parent
8459e10c73
commit
f1eaa51e38
2 files changed
+31
-10
No files matched your search
@@ -15,7 +15,7 @@ use Carbon\Carbon;
|
|||||||
class MaglooKeniaAll
|
class MaglooKeniaAll
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Provider ID 2
|
* Provider Id 3
|
||||||
*/
|
*/
|
||||||
public static function run()
|
public static function run()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,42 +2,47 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands\DbMapper;
|
namespace App\Console\Commands\DbMapper;
|
||||||
|
|
||||||
use App\Console\Commands\DbMapper\Helper\FindCompetitionGroup;
|
use App\Console\Commands\DbMapper\Helper\FindCompetitionGroupById;
|
||||||
use App\Console\Commands\DbMapper\Helper\FindElement;
|
use App\Console\Commands\DbMapper\Helper\FindElementById;
|
||||||
use App\Console\Commands\DbMapper\Store\StoreElement;
|
use App\Console\Commands\DbMapper\Store\StoreElement;
|
||||||
use App\Console\Commands\DbMapper\Store\StoreGroup;
|
use App\Console\Commands\DbMapper\Store\StoreGroup;
|
||||||
use App\Console\Commands\Nuh;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\Event;
|
use App\Models\Event;
|
||||||
use App\Models\Mapper;
|
use App\Models\Mapper;
|
||||||
use App\Models\Sport;
|
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class MaglooNigeriaAll
|
class MaglooNigeriaAll
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Provider ID 2
|
* Provider Id 4
|
||||||
*/
|
*/
|
||||||
public static function run()
|
public static function run()
|
||||||
{
|
{
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
|
$provider_id = 4;
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note(Nuh::$options['name'], 'g');
|
Notice::note(Nuh::$options['name'], 'g');
|
||||||
}
|
}
|
||||||
|
|
||||||
$sports = Sport::map('magl');
|
$sports = [1, 3];
|
||||||
|
|
||||||
$mappers = Mapper::where('provider_id', 2)->where('sport_id', 5)->where('starttime', '>=', Carbon::now())->get()->toArray();
|
$found = [];
|
||||||
|
|
||||||
|
foreach ($sports as $sport_id) {
|
||||||
|
|
||||||
|
$mappers = Mapper::where('provider_id', $provider_id)->where('sport_id', $sport_id)->where('starttime', '>=', Carbon::now())->get()->toArray();
|
||||||
|
|
||||||
foreach ($mappers as $mapper) {
|
foreach ($mappers as $mapper) {
|
||||||
|
|
||||||
FindElement::run($mapper);
|
FindElementById::run($mapper);
|
||||||
|
|
||||||
FindCompetitionGroup::run($mapper);
|
FindCompetitionGroupById::run($mapper);
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
Notice::note($mapper, 'b');
|
Notice::note($mapper, 'p');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($mapper['txodds_home_id'] && $mapper['txodds_away_id'] && $mapper['txodds_group_id']) {
|
if ($mapper['txodds_home_id'] && $mapper['txodds_away_id'] && $mapper['txodds_group_id']) {
|
||||||
@@ -53,6 +58,17 @@ class MaglooNigeriaAll
|
|||||||
->first();
|
->first();
|
||||||
|
|
||||||
if ($event) {
|
if ($event) {
|
||||||
|
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note($event, 'g');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! isset($found[$sport_id])) {
|
||||||
|
$found[$sport_id] = 1;
|
||||||
|
} else {
|
||||||
|
$found[$sport_id]++;
|
||||||
|
}
|
||||||
|
|
||||||
StoreElement::store($mapper);
|
StoreElement::store($mapper);
|
||||||
|
|
||||||
StoreGroup::store($mapper);
|
StoreGroup::store($mapper);
|
||||||
@@ -80,4 +96,9 @@ class MaglooNigeriaAll
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($debug) {
|
||||||
|
Notice::note($found, 'g');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user