multilines wip
This commit is contained in:
1 parent
218c1e6e1c
commit
825a8d430c
19 files changed
+145
-78
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions;
|
||||
|
||||
use App\Models\Multiline;
|
||||
|
||||
class MultilineSlots
|
||||
{
|
||||
public static function addSlots(&$data, $bettype_id, $matchpart_id)
|
||||
{
|
||||
$slots = Multiline::where('sport_id', auth()->user()->sport_id)
|
||||
->where('client_id', auth()->user()->client_id)
|
||||
->where('bettype_id', $bettype_id)
|
||||
->where('matchpart_id', $matchpart_id)
|
||||
->with('bookmaker')
|
||||
->orderBy('sort')
|
||||
->get();
|
||||
|
||||
$multilines = [];
|
||||
foreach ($slots as $id => $slot) {
|
||||
$open = true;
|
||||
foreach ($data as $item) {
|
||||
if ($slot->bookmaker_id == $item->bookmaker_id) {
|
||||
$multilines[$id] = $item;
|
||||
$open = false;
|
||||
}
|
||||
}
|
||||
if ($open) {
|
||||
$multilines[$id] = $slot;
|
||||
}
|
||||
}
|
||||
|
||||
return $multilines;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user