Football functions.php angepasst, damit ertippte Punkte bei ihren jeweiligen Teams als Tore eingetragen werden.

This commit is contained in:
2018-02-19 21:56:29 +01:00
parent 7d8b92f1df
commit 6b9ebb0d1a

View File

@@ -254,6 +254,7 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
}
$i++;
}
$league2 = $league + 50;
foreach( $ranking_ary AS $curr_user => $curr_rank)
{
if ( round($money[$curr_rank['rank']] / $equal_rank[$curr_rank['rank']], 2) <> 0 )
@@ -282,6 +283,25 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
,0
)";
$db->sql_query($sql);
if ($league < 51)
{
$curr_rank_points = $curr_rank['points'];
$curr_rank_user = $curr_rank['user_id'] + 2000;
$sql = 'UPDATE ' . FOOTB_MATCHES . "
SET goals_home = $curr_rank_points,
status = $matchday_status
WHERE season = $season AND league = $league2 AND matchday = $matchday AND team_id_home = $curr_rank_user";
$db->sql_query($sql);
$sql = 'UPDATE ' . FOOTB_MATCHES . "
SET goals_guest = $curr_rank_points,
status = $matchday_status
WHERE season = $season AND league = $league2 AND matchday = $matchday AND team_id_guest = $curr_rank_user";
$db->sql_query($sql);
$sql = 'UPDATE ' . FOOTB_MATCHDAYS . "
SET status = $matchday_status
WHERE season = $season AND league = $league2 AND matchday = $matchday";
$db->sql_query($sql);
}
}
if ( sizeof($ranking_ary) == 0 )
{
@@ -290,6 +310,15 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
AND league = $league
AND matchday = $matchday";
$db->sql_query($sql);
if ($league < 51)
{
$sql = 'UPDATE ' . FOOTB_MATCHES . "
SET goals_home = '',
goals_guest = '',
status = $matchday_status
WHERE season = $season AND league = $league2 AND matchday = $matchday;";
$db->sql_query($sql);
}
}
else
{
@@ -1033,7 +1062,8 @@ function current_league($season)
$sql = 'SELECT DISTINCT m.league
FROM ' . FOOTB_MATCHES . ' AS m
INNER JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league ' . $user_spec . ")
WHERE m.season = $season
WHERE m.season = $season
AND league < 51
AND m.status in (0,1,2)
ORDER BY m.match_datetime ASC
LIMIT 1";