cleanup comparatore

This commit is contained in:
salam committed 2025-12-12 07:35:03 +01:00
1 parent 2052ccdd77
commit adaec7b3dc
21 files changed
+98 -205

No files matched your search

-25
View File
@@ -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);
}
}
-40
View File
@@ -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;
}
}