wip
This commit is contained in:
1 parent
e09e42ab41
commit
fc1e1b2832
6 files changed
+200
-115
No files matched your search
@@ -10,7 +10,8 @@ class Expectation1X2
|
||||
public static function load(array &$expectations, array $filter, object $match)
|
||||
{
|
||||
$team_id = (int) $filter['team_id'] ?? 0;
|
||||
$team_position = $filter['team_position'];
|
||||
$home_id = $match->home_id;
|
||||
$away_id = $match->away_id;
|
||||
|
||||
$res_tp = LoadEventsQueryTP::load($filter, $match);
|
||||
|
||||
@@ -19,7 +20,7 @@ class Expectation1X2
|
||||
|
||||
$expectations += ['win_count' => 0, 'draw_count' => 0, 'lost_count' => 0];
|
||||
foreach ($res_tp as $value) {
|
||||
if ($team_id && $team_position == 'home') {
|
||||
if ($value->home_id == $team_id) {
|
||||
switch ($value['result_code']) {
|
||||
case '1':
|
||||
$expectations['win_count']++;
|
||||
@@ -31,15 +32,15 @@ class Expectation1X2
|
||||
$expectations['lost_count']++;
|
||||
break;
|
||||
}
|
||||
} elseif ($team_id && $team_position == 'away') {
|
||||
} elseif ($value->away_id == $team_id) {
|
||||
switch ($value['result_code']) {
|
||||
case '1':
|
||||
case '2':
|
||||
$expectations['win_count']++;
|
||||
break;
|
||||
case 'X':
|
||||
$expectations['draw_count']++;
|
||||
break;
|
||||
case '2':
|
||||
case '1':
|
||||
$expectations['lost_count']++;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -106,8 +106,11 @@ class PlayerPropsDrop extends Widget
|
||||
public function syncData(?int $team_id)
|
||||
{
|
||||
if ($team_id) {
|
||||
|
||||
$this->players = PlayerCalculator::load($team_id);
|
||||
|
||||
$this->team_name = SofaScoreRosa::where('ss_team_id', $team_id)->value('ss_team_name');
|
||||
|
||||
$this->team_id = $team_id;
|
||||
$this->loadPlacement();
|
||||
} else {
|
||||
@@ -176,7 +179,6 @@ class PlayerPropsDrop extends Widget
|
||||
$res = SsLineupMemory::where('client_id', Auth::user()->client_id)->where('team_id', $this->team_id)->where('lineup', $this->activeLineUp)->first();
|
||||
|
||||
if ($res) {
|
||||
// Log::debug('SsLineupMemory', $res->toArray());
|
||||
|
||||
$placement = json_decode($res->placement, 1);
|
||||
|
||||
|
||||
Reference in new issue
Block a user