mapper wip
This commit is contained in:
1 parent
ba6c2263e3
commit
02712ec610
27 files changed
+1070
-158
No files matched your search
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Mapper extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'sport_id',
|
||||
'provider_id',
|
||||
'tx_id',
|
||||
'betradar_id',
|
||||
'betradar_id',
|
||||
'betsapi_id',
|
||||
'bet365_id',
|
||||
'_1xbet_id',
|
||||
'betfairsb_id',
|
||||
'starttime',
|
||||
'group',
|
||||
'group_id',
|
||||
'group_cc',
|
||||
'home',
|
||||
'home_id',
|
||||
'home_cc',
|
||||
'away',
|
||||
'away_id',
|
||||
'away_cc',
|
||||
];
|
||||
}
|
||||
@@ -7,13 +7,13 @@ use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Sport extends Model
|
||||
{
|
||||
public static function map($field)
|
||||
public static function map($field, $_limit = [])
|
||||
{
|
||||
if (! in_array($field, ['bapi', 'bwin', 'b365', 'logi', 'magl'])) {
|
||||
Notice::note('Wrong Option! Possible options: bapi, bwin, b365, logi, magl', 'r', 1);
|
||||
Notice::note('Sport::map wrong option! Possible options: bapi, bwin, b365, logi, magl', 'r', 1);
|
||||
}
|
||||
|
||||
return Sport::where('is_active', 1)->pluck($field, 'id')->toArray();
|
||||
return Sport::where('is_active', 1)->whereNotIn('id', $_limit)->pluck($field, 'id')->toArray();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user