Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
diddipoeler authored Jan 24, 2024
1 parent 981f2df commit 2ff3350
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions admin/models/matches.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ function prepareItems($items)
{
$players = implode(",", $result);

/** Count match homeplayers */
$this->jsmquery->clear();
$this->jsmquery->select('count(mp.id)');
$this->jsmquery->from('#__sportsmanagement_match_player AS mp ');
$this->jsmquery->where('mp.match_id = ' . $item->id . ' AND (came_in=0 OR came_in=1) AND mp.teamplayer_id in (' . $players . ')');
$this->jsmdb->setQuery($this->jsmquery);
$item->homestaff_count = $this->jsmdb->loadResult();
/** Count match homestaff */
$this->jsmquery->clear();
$this->jsmquery->select('count(mp.id)');
$this->jsmquery->from('#__sportsmanagement_match_staff AS mp ');
$this->jsmquery->where('mp.match_id = ' . $item->id . ' AND mp.team_staff_id in (' . $players . ')');
$this->jsmdb->setQuery($this->jsmquery);
$item->homestaff_count = $this->jsmdb->loadResult();
}

$this->jsmquery->clear();
Expand Down Expand Up @@ -155,13 +155,13 @@ function prepareItems($items)
{
$players = implode(",", $result);

/** Count match homeplayers */
$this->jsmquery->clear();
$this->jsmquery->select('count(mp.id)');
$this->jsmquery->from('#__sportsmanagement_match_player AS mp ');
$this->jsmquery->where('mp.match_id = ' . $item->id . ' AND (came_in=0 OR came_in=1) AND mp.teamplayer_id in (' . $players . ')');
$this->jsmdb->setQuery($this->jsmquery);
$item->awaystaff_count = $this->jsmdb->loadResult();
/** Count match awaystaff */
$this->jsmquery->clear();
$this->jsmquery->select('count(mp.id)');
$this->jsmquery->from('#__sportsmanagement_match_staff AS mp ');
$this->jsmquery->where('mp.match_id = ' . $item->id . ' AND mp.team_staff_id in (' . $players . ')');
$this->jsmdb->setQuery($this->jsmquery);
$item->awaystaff_count = $this->jsmdb->loadResult();
}

$this->jsmquery->clear();
Expand Down

0 comments on commit 2ff3350

Please sign in to comment.