wip del err
This commit is contained in:
1 parent
812736ca9a
commit
9bcd4432c6
1210 files changed
-220941
No files matched your search
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\OddsTable;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class AlarmStatistic
|
||||
{
|
||||
public static function load()
|
||||
{
|
||||
$res = OddsTable::select('name', 'fieldnames')->get();
|
||||
$fields = [];
|
||||
foreach ($res as $value) {
|
||||
$fields[$value->name] = explode(',', $value->fieldnames);
|
||||
}
|
||||
|
||||
$events = Event::with('event_bookmaker')
|
||||
->where('sport_id', auth()->user()->sport_id)
|
||||
->where('starttime', '>=', Carbon::now())
|
||||
->whereHas('event_bookmaker', function ($query) {
|
||||
$query->where('bookmaker_id', auth()->user()->bookmaker_id);
|
||||
})
|
||||
->get();
|
||||
|
||||
$arr = [];
|
||||
foreach ($events as $event) {
|
||||
$row = $event->event_bookmaker;
|
||||
// $row = get_object_vars($event->toArray());
|
||||
foreach ($fields as $table => $names) {
|
||||
foreach ($names as $name) {
|
||||
$val = (int) $row[$name];
|
||||
if ($val) {
|
||||
if (isset($arr[$table][$val])) {
|
||||
$arr[$table][$val]++;
|
||||
} else {
|
||||
$arr[$table][$val] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user