Merge remote-tracking branch 'football/master'
# Conflicts: # acp/matches_module.php # adm/style/acp_football_leagues.html # adm/style/acp_football_matches.html # block/all_bets.php # block/rank_matchday.php # block/ranks_total.php # config/services.yml # controller/main.php # event/main_listener.php # includes/constants.php # includes/functions.php # language/de/football.php # language/de/info_acp_leagues.php # language/de/info_acp_matches.php # styles/prosilver/template/all_bets.html # styles/prosilver/template/results.html # styles/prosilver/template/table.html # styles/prosilver/theme/football.css
This commit is contained in:
@@ -170,8 +170,8 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
|
||||
INNER JOIN ' . FOOTB_BETS . ' AS b ON (b.season = m.season AND b.league = m.league AND b.match_no = m.match_no)
|
||||
INNER JOIN ' . USERS_TABLE . " AS u ON (b.user_id = u.user_id)
|
||||
WHERE m.season = $season AND m.league = $league AND m.matchday = $matchday AND m.status IN (2,3)
|
||||
GROUP BY b.user_id
|
||||
ORDER BY points DESC, nobet ASC, username ASC
|
||||
GROUP BY u.user_id
|
||||
ORDER BY points DESC, nobet ASC, u.username ASC
|
||||
";
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
@@ -287,21 +287,21 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
|
||||
{
|
||||
$curr_rank_points = $curr_rank['points'];
|
||||
$curr_rank_user = $curr_rank['user_id'] + 2000;
|
||||
$sql = 'UPDATE ' . FOOTB_MATCHES . "
|
||||
$sql = 'UPDATE ' . FOOTB_MATCHES . "
|
||||
SET goals_home = $curr_rank_points,
|
||||
status = $matchday_status
|
||||
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 . "
|
||||
$sql = 'UPDATE ' . FOOTB_MATCHES . "
|
||||
SET goals_guest = $curr_rank_points,
|
||||
status = $matchday_status
|
||||
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
|
||||
$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 )
|
||||
{
|
||||
@@ -312,13 +312,13 @@ function save_ranking_matchday($season, $league, $matchday, $cash = false)
|
||||
$db->sql_query($sql);
|
||||
if ($league < 51)
|
||||
{
|
||||
$sql = 'UPDATE ' . FOOTB_MATCHES . "
|
||||
$sql = 'UPDATE ' . FOOTB_MATCHES . "
|
||||
SET goals_home = '',
|
||||
goals_guest = '',
|
||||
status = $matchday_status
|
||||
status = $matchday_status
|
||||
WHERE season = $season AND league = $league2 AND matchday = $matchday;";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -615,13 +615,13 @@ function set_footb_points($points_type, $season, $league, $matchday, $wins, $cas
|
||||
|
||||
function _sort_points($value_a, $value_b)
|
||||
{
|
||||
if ($value_a['points'] > $value_b['points'])
|
||||
if ($value_a['points'] > $value_b['points'])
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($value_a['points'] == $value_b['points'])
|
||||
if ($value_a['points'] == $value_b['points'])
|
||||
{
|
||||
if (isset($value_a['nobet']))
|
||||
{
|
||||
@@ -645,12 +645,12 @@ function _sort_points($value_a, $value_b)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -893,7 +893,8 @@ function next_delivery($season, $league)
|
||||
WHEN 6 THEN '" . $lang_dates['Sat'] . "'
|
||||
ELSE 'Error' END,
|
||||
DATE_FORMAT(delivery_date,' %d.%m.%Y %H:%i')
|
||||
) AS deliverytime
|
||||
) AS deliverytime,
|
||||
matchday
|
||||
FROM " . FOOTB_MATCHDAYS . "
|
||||
WHERE season = $season AND league = $league AND status = 0
|
||||
ORDER BY matchday ASC
|
||||
@@ -1054,7 +1055,7 @@ function first_league($season, $complete = true)
|
||||
{
|
||||
$join_matchday = 'INNER JOIN ' . FOOTB_MATCHDAYS . ' AS m ON (m.season = l.season AND m.league = l.league) ';
|
||||
}
|
||||
$sql = 'SELECT *
|
||||
$sql = 'SELECT l.*
|
||||
FROM ' . FOOTB_LEAGUES . ' AS l ' .
|
||||
$join_matchday . "
|
||||
WHERE l.season = $season
|
||||
@@ -1085,13 +1086,13 @@ function current_league($season)
|
||||
$curr_user = $user->data['user_id'];
|
||||
$user_spec = 'AND b.user_id = ' . $curr_user;
|
||||
}
|
||||
$sql = 'SELECT DISTINCT m.league
|
||||
$sql = 'SELECT DISTINCT m.league, m.match_datetime
|
||||
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
|
||||
AND m.league < 51
|
||||
AND m.status in (0,1,2)
|
||||
ORDER BY m.match_datetime ASC
|
||||
ORDER BY m.match_datetime ASC, m.league ASC
|
||||
LIMIT 1";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
@@ -1723,7 +1724,7 @@ function get_order_team_compare($team_ary, $season, $league, $group, $ranks, $ma
|
||||
IF(goals_home + 0 > goals_guest, 3, IF(goals_home = goals_guest, 1, 0)),
|
||||
IF(goals_home + 0 < goals_guest, 3, IF(goals_home = goals_guest, 1, 0))
|
||||
)
|
||||
) + IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday),0)
|
||||
) + IFNULL((SELECT SUM(b.bonuspoints) FROM " . FOOTB_BONUS_DAY . " AS b WHERE b.team_id = t.team_id AND b.season = t.season AND b.league = t.league AND b.matchday <= $matchday),0)
|
||||
+ IFNULL((SELECT SUM(c.points) FROM " . FOOTB_CORR . " AS c WHERE c.team_id = t.team_id AND c.season = t.season AND c.league = t.league AND c.matchday <= $matchday),0)
|
||||
- IF(t.team_id = 20 AND t.season = 2011 AND $matchday > 7, 2, 0) AS points,
|
||||
SUM(IF(m.team_id_home = t.team_id, goals_home - goals_guest, goals_guest - goals_home)) AS goals_diff,
|
||||
@@ -1886,7 +1887,7 @@ function get_team($season, $league, $matchnumber, $field, $formula)
|
||||
$third_group[$team]= $row['group_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sort 3. Place on points, diff, goals
|
||||
array_multisort($points3, SORT_DESC, $diff3, SORT_DESC, $goals3, SORT_DESC, $third_team, $third_group);
|
||||
@@ -2156,7 +2157,8 @@ function get_team($season, $league, $matchnumber, $field, $formula)
|
||||
m.goals_overtime_home,
|
||||
m.goals_overtime_guest,
|
||||
m.goals_home,
|
||||
m.goals_guest
|
||||
m.goals_guest,
|
||||
m.match_no
|
||||
FROM ' . FOOTB_MATCHES . ' AS m
|
||||
LEFT JOIN ' . FOOTB_TEAMS . ' AS t1 ON (t1.season = m.season AND t1.league = m.league AND t1.team_id = m.team_id_home)
|
||||
LEFT JOIN ' . FOOTB_TEAMS . " AS t2 ON (t2.season = m.season AND t2.league = m.league AND t2.team_id = m.team_id_guest)
|
||||
@@ -2376,7 +2378,7 @@ function ko_group_next_round($season, $league, $matchday_from, $matchday_to, $ma
|
||||
LEFT JOIN ' . FOOTB_MATCHES . " AS m ON (m.season = t.season AND m.league = t.league AND (m.team_id_home = t.team_id OR m.team_id_guest = t.team_id) AND m.group_id = t.group_id)
|
||||
WHERE t.season = $season AND t.league = $league AND m.matchday >= $matchday_from AND m.matchday <= $matchday_to AND m.status IN (3,6)
|
||||
GROUP BY t.team_id
|
||||
ORDER BY group_id ASC,points DESC, goal_diff DESC, goals DESC
|
||||
ORDER BY t.group_id ASC, points DESC, goal_diff DESC, goals DESC
|
||||
";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
@@ -2649,7 +2651,7 @@ function bonuspoints($season, $league, $matchday)
|
||||
{
|
||||
$z3 = "0";
|
||||
}
|
||||
|
||||
|
||||
If ($z1 > 2)
|
||||
{
|
||||
$b1 = 6 / $z1;
|
||||
@@ -2820,4 +2822,3 @@ function chart($season, $league, $matchday)
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user