remove lastcontrol timestamp
This commit is contained in:
1 parent
cc8ddb544b
commit
0742b6c19f
65 files changed
+132
-313
No files matched your search
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
namespace App\Filament\Tables\Columns;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
class FilterOdds
|
||||
{
|
||||
public static function filter(&$bookmakers)
|
||||
{
|
||||
if (auth()->user()->is_multiline_direct) {
|
||||
/**
|
||||
* ORDER
|
||||
*/
|
||||
$order = $bookmakers['bookmaker'] ?? [];
|
||||
|
||||
ColumnOdds::$data->sortBy(function ($model) use ($order) {
|
||||
return array_search($model->bookmaker_id, $order);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* SET SLOT
|
||||
*/
|
||||
// $filter = $bookmakers['filter'] ?? [];
|
||||
|
||||
// if ($filter) {
|
||||
// $data = $data->filter(function ($model) use ($filter) {
|
||||
|
||||
// if ($model->bookmaker_id == auth()->user()->bookmaker_id) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// $filter = $filter[$model->bookmaker_id] ?? 0;
|
||||
|
||||
// $checked_at = Carbon::createFromDate($model->checked_at)->timestamp;
|
||||
|
||||
// if (! isset($filter['margin'])) {
|
||||
// Bookmakers::updateOrCreate(['id' => (int) $model->bookmaker_id], ['need_check' => 1]);
|
||||
// }
|
||||
|
||||
// if ($model->margin <= $filter['margin'] && $checked_at > time() - $filter['time_lastcheck']) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// return false;
|
||||
// });
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ namespace App\Filament\Tables\Columns;
|
||||
|
||||
use App\Utilities\BkmIconMap;
|
||||
use Filament\Tables\Columns\Column;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class TooltipOdds extends Column
|
||||
{
|
||||
@@ -149,7 +148,7 @@ class TooltipOdds extends Column
|
||||
$this->pop .= $this->getOdd($value[$oddname], $oddname);
|
||||
}
|
||||
$this->pop .= $this->getMargin($value->margin);
|
||||
$this->pop .= $this->getCheck($value->checked_at);
|
||||
$this->pop .= $this->getFlags($value->flags);
|
||||
if ($k % 2 == 0 && $this->size > $this->two_cols_break) {
|
||||
$this->pop .= '<div></div>';
|
||||
}
|
||||
@@ -182,21 +181,13 @@ class TooltipOdds extends Column
|
||||
$this->pop .= $str.number_format($odd, 1).'</div>';
|
||||
}
|
||||
|
||||
public function getCheck($lastcheck)
|
||||
public function getFlags($flags)
|
||||
{
|
||||
$lastcheck_5min = Carbon::createFromDate($lastcheck)->addMinutes(5);
|
||||
$lastcheck_30min = Carbon::createFromDate($lastcheck)->addMinutes(30);
|
||||
$now = Carbon::now();
|
||||
|
||||
if ($lastcheck_30min->lt($now)) {
|
||||
$this->pop .= '<div class="text-xs text-nowrap bg-red-600/20 rounded shadow">';
|
||||
} elseif ($lastcheck_5min->lt($now)) {
|
||||
$this->pop .= '<div class="text-xs text-nowrap bg-blue-600/20 rounded">';
|
||||
if ($flags) {
|
||||
$this->pop .= '<div></div>';
|
||||
} else {
|
||||
$this->pop .= '<div class="text-xs text-nowrap">';
|
||||
$this->pop .= '<div><x-filament::icon-button icon="heroicon-m-exclamation-triangle" color="info" /></div>';
|
||||
}
|
||||
|
||||
$this->pop .= Carbon::createFromDate($lastcheck)->format('H:i').'</div>';
|
||||
}
|
||||
|
||||
public function makeHeader()
|
||||
|
||||
Reference in new issue
Block a user