cleanup comparatore
This commit is contained in:
1 parent
2052ccdd77
commit
adaec7b3dc
21 files changed
+98
-205
No files matched your search
@@ -9,9 +9,6 @@ use App\Utilities\Notice;
|
||||
|
||||
class TxSwitch
|
||||
{
|
||||
/**
|
||||
* https://docs.guzzlephp.org/en/latest/
|
||||
*/
|
||||
public static function switch()
|
||||
{
|
||||
if (NuhBash::$options['sport_id'] == 1) {
|
||||
|
||||
@@ -14,6 +14,7 @@ class BettypesTable
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->striped()
|
||||
->columns([
|
||||
TextColumn::make('bettype_id')
|
||||
->width('1rem')
|
||||
|
||||
@@ -15,6 +15,7 @@ class BookmakersTable
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->striped()
|
||||
->columns([
|
||||
TextColumn::make('name')
|
||||
->searchable(),
|
||||
|
||||
@@ -15,6 +15,7 @@ class ClientsTable
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->striped()
|
||||
->columns([
|
||||
TextColumn::make('name'),
|
||||
TextColumn::make('bookmaker')
|
||||
|
||||
@@ -56,6 +56,7 @@ class CountryResource extends Resource
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->striped()
|
||||
->recordTitleAttribute('name')
|
||||
->columns([
|
||||
TextColumn::make('id')->searchable(),
|
||||
|
||||
@@ -62,7 +62,9 @@ class EventResource extends Resource
|
||||
|
||||
public static function getEloquentQuery(): Builder
|
||||
{
|
||||
return parent::getEloquentQuery()->withoutGlobalScopes()->with('odds_3way');
|
||||
// return parent::getEloquentQuery()->withoutGlobalScopes()->with('odds_3way')->where('starttime', '>', Carbon::now());
|
||||
return parent::getEloquentQuery()
|
||||
->where('starttime', '>', Carbon::now())
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->withoutGlobalScopes()->with('odds_3way');
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@ class EventsTable
|
||||
{
|
||||
return $table
|
||||
->poll('10s')
|
||||
->striped()
|
||||
->columns([
|
||||
IconColumn::make('sport.icon')
|
||||
->label('')
|
||||
|
||||
@@ -11,6 +11,7 @@ class ProvidersTable
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->striped()
|
||||
->columns([
|
||||
TextColumn::make('id'),
|
||||
TextColumn::make('name'),
|
||||
|
||||
@@ -44,6 +44,7 @@ class SportResource extends Resource
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->striped()
|
||||
->columns([
|
||||
IconColumn::make('icon')
|
||||
->label('')
|
||||
|
||||
@@ -14,6 +14,7 @@ class SupervisorsTable
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->striped()
|
||||
->columns([
|
||||
TextColumn::make('id')->badge(),
|
||||
TextColumn::make('name')->searchable(),
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AlarmSetting extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Comparatore extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'match_id',
|
||||
'sport_id',
|
||||
'bookmaker_id',
|
||||
'pushmode',
|
||||
'hash',
|
||||
'fdata',
|
||||
];
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ComparatoreSetting extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Utilities;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Http\Client\PendingRequest;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class Guzzle
|
||||
{
|
||||
public static function load($url, $debug = 0)
|
||||
{
|
||||
BetsapiCounter::count($debug);
|
||||
|
||||
if ($debug) {
|
||||
Notice::note($url, 'g');
|
||||
}
|
||||
|
||||
$data = Http::retry(3, 2, function (Exception $exception, PendingRequest $request) {
|
||||
return $exception instanceof ConnectionException;
|
||||
})->get($url);
|
||||
|
||||
return json_decode($data, true);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Utilities;
|
||||
|
||||
use App\Models\Comparatore;
|
||||
use App\Models\EventCustomer;
|
||||
|
||||
class NuhHash
|
||||
{
|
||||
public static function md5($data)
|
||||
{
|
||||
if (is_array($data)) {
|
||||
$data = serialize($data);
|
||||
}
|
||||
|
||||
return hash('md5', $data, false);
|
||||
}
|
||||
|
||||
public static function comparatore_all($options)
|
||||
{
|
||||
$res = Comparatore::select('event_id', 'hash', 'updated_at')->where('sport_id', $options['sport_id'])->where('customer_id', $options['customer_id'])->get();
|
||||
$_hash = [];
|
||||
foreach ($res as $value) {
|
||||
$event_id = $value['event_id'];
|
||||
$_hash[$event_id] = ['hash' => $value['hash'], 'timestamp' => strtotime($value['updated_at'])];
|
||||
}
|
||||
|
||||
return $_hash;
|
||||
}
|
||||
|
||||
public static function load_event($options)
|
||||
{
|
||||
$res = EventCustomer::select('calculation_hash')->where('event_id', $options['event_id'])->where('customer_id', $options['customer_id'])->first();
|
||||
if ($res) {
|
||||
return $res->calculation_hash;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user