Skip to content

Commit

Permalink
Revert "Fix queries for MySQL 8.0+"
Browse files Browse the repository at this point in the history
  • Loading branch information
M0st1ce authored Sep 28, 2020
1 parent 4c5a16e commit 26fbd38
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 139 deletions.
52 changes: 26 additions & 26 deletions modules/LevelsRanks/module_block_main_top/forward/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
if ( ! empty( $Db->db_data['LevelsRanks'] ) ):
for ($d = 0; $d < $Db->table_count['LevelsRanks']; $d++ ):
// Забираем массив даннхы
$data['module_block_main_top'][] = $Db->queryAll( 'LevelsRanks', $Db->db_data['LevelsRanks'][$d]['USER_ID'], $Db->db_data['LevelsRanks'][$d]['DB_num'],'SELECT `name`, `rank`, `steam`, `playtime`, `value`, `kills`, `deaths`, CASE WHEN `deaths` = 0 THEN `deaths` = 1 END, TRUNCATE( `kills`/`deaths`, 2 ) AS `kd` FROM `' . $Db->db_data['LevelsRanks'][ $d ]['Table'] . '` WHERE `lastconnect` > 0 order by `value` desc LIMIT 10' );
$data['module_block_main_top'][] = $Db->queryAll( 'LevelsRanks', $Db->db_data['LevelsRanks'][$d]['USER_ID'], $Db->db_data['LevelsRanks'][$d]['DB_num'],'SELECT name, rank, steam, playtime, value, kills, deaths, CASE WHEN deaths = 0 THEN deaths = 1 END, TRUNCATE( kills/deaths, 2 ) AS kd FROM ' . $Db->db_data['LevelsRanks'][ $d ]['Table'] . ' WHERE lastconnect > 0 order by `value` desc LIMIT 10' );
endfor;
endif;

Expand All @@ -23,17 +23,17 @@
for ($d = 1; $d <= $Db->table_count['FPS']; $d++ ):
// Забираем массив даннхы
$data['module_block_main_top'][] = $Db->queryAll( 'FPS', 0, 0,
'SELECT `fps_players`.`nickname` AS `name`,
`fps_players`.`steam_id` AS `steam`,
`fps_servers_stats`.`points` AS `value`,
`fps_servers_stats`.`kills`,
`fps_servers_stats`.`deaths`,
`fps_servers_stats`.`playtime`,
`fps_servers_stats`.`rank`,
CASE WHEN `fps_servers_stats`.`deaths` = 0 THEN `fps_servers_stats`.`deaths` = 1 END, TRUNCATE( `fps_servers_stats`.`kills`/`fps_servers_stats`.`deaths`, 2 ) AS `kd`
FROM `fps_players`
INNER JOIN `fps_servers_stats` ON `fps_players`.`account_id` = `fps_servers_stats`.`account_id`
WHERE `fps_servers_stats`.`server_id` = ' . $d . ' AND `fps_servers_stats`.`lastconnect` > 0
'SELECT fps_players.nickname AS name,
fps_players.steam_id AS steam,
fps_servers_stats.points AS value,
fps_servers_stats.kills,
fps_servers_stats.deaths,
fps_servers_stats.playtime,
fps_servers_stats.rank,
CASE WHEN fps_servers_stats.deaths = 0 THEN fps_servers_stats.deaths = 1 END, TRUNCATE( fps_servers_stats.kills/fps_servers_stats.deaths, 2 ) AS kd
FROM fps_players
INNER JOIN fps_servers_stats ON fps_players.account_id = fps_servers_stats.account_id
WHERE fps_servers_stats.server_id = ' . $d . ' AND fps_servers_stats.lastconnect > 0
order by `value` desc LIMIT 10' );
endfor;
endif;
Expand All @@ -42,7 +42,7 @@
if ( ! empty( $Db->db_data['RankMeKento'] ) ):
for ($d = 0; $d < $Db->table_count['RankMeKento']; $d++ ):
// Забираем массив даннхы
$data['module_block_main_top'][] = $Db->queryAll( 'RankMeKento', $Db->db_data['RankMeKento'][$d]['USER_ID'], $Db->db_data['RankMeKento'][$d]['DB_num'],'SELECT `name`, `steam`, `connected` AS `playtime`, `score` AS `value`, `kills`, `deaths`, CASE WHEN `deaths` = 0 THEN `deaths` = 1 END, TRUNCATE( `kills`/`deaths`, 2 ) AS `kd` FROM `' . $Db->db_data['RankMeKento'][ $d ]['Table'] . '` WHERE `lastconnect` > 0 order by `value` desc LIMIT 10' );
$data['module_block_main_top'][] = $Db->queryAll( 'RankMeKento', $Db->db_data['RankMeKento'][$d]['USER_ID'], $Db->db_data['RankMeKento'][$d]['DB_num'],'SELECT `name`, steam, connected AS playtime, score AS `value`, kills, deaths, CASE WHEN deaths = 0 THEN deaths = 1 END, TRUNCATE( kills/deaths, 2 ) AS kd FROM ' . $Db->db_data['RankMeKento'][ $d ]['Table'] . ' WHERE lastconnect > 0 order by `value` desc LIMIT 10' );
endfor;
endif;

Expand All @@ -63,7 +63,7 @@
if ( ! empty( $Db->db_data['LevelsRanks'] ) ):
for ($d = 0; $d < $Db->table_count['LevelsRanks']; $d++ ):
// Забираем массив даннхы
$data['module_block_main_top'][] = $Db->queryAll( 'LevelsRanks', $Db->db_data['LevelsRanks'][$d]['USER_ID'], $Db->db_data['LevelsRanks'][$d]['DB_num'],'SELECT `name`, `rank`, `steam`, `playtime`, `value`, `kills`, `deaths`, CASE WHEN `deaths` = 0 THEN `deaths` = 1 END, TRUNCATE( `kills`/`deaths`, 2 ) AS `kd` FROM `' . $Db->db_data['LevelsRanks'][ $d ]['Table'] . '` WHERE `lastconnect` > 0 order by `value` desc LIMIT 10' );
$data['module_block_main_top'][] = $Db->queryAll( 'LevelsRanks', $Db->db_data['LevelsRanks'][$d]['USER_ID'], $Db->db_data['LevelsRanks'][$d]['DB_num'],'SELECT name, rank, steam, playtime, value, kills, deaths, CASE WHEN deaths = 0 THEN deaths = 1 END, TRUNCATE( kills/deaths, 2 ) AS kd FROM ' . $Db->db_data['LevelsRanks'][ $d ]['Table'] . ' WHERE lastconnect > 0 order by `value` desc LIMIT 10' );
endfor;
endif;

Expand All @@ -72,17 +72,17 @@
for ($d = 1; $d <= $Db->table_count['FPS']; $d++ ):
// Забираем массив даннхы
$data['module_block_main_top'][] = $Db->queryAll( 'FPS', 0, 0,
'SELECT `fps_players`.`nickname` AS `name`,
`fps_players`.`steam_id` AS `steam`,
`fps_servers_stats`.`points` AS `value`,
`fps_servers_stats`.`kills`,
`fps_servers_stats`.`deaths`,
`fps_servers_stats`.`playtime`,
`fps_servers_stats`.`rank`,
CASE WHEN `fps_servers_stats`.`deaths` = 0 THEN `fps_servers_stats`.`deaths` = 1 END, TRUNCATE( `fps_servers_stats`.`kills`/`fps_servers_stats`.`deaths`, 2 ) AS `kd`
FROM `fps_players`
INNER JOIN `fps_servers_stats` ON `fps_players`.`account_id` = `fps_servers_stats`.`account_id`
WHERE `fps_servers_stats`.`server_id` = ' . $d . ' AND `fps_servers_stats`.`lastconnect` > 0
'SELECT fps_players.nickname AS name,
fps_players.steam_id AS steam,
fps_servers_stats.points AS value,
fps_servers_stats.kills,
fps_servers_stats.deaths,
fps_servers_stats.playtime,
fps_servers_stats.rank,
CASE WHEN fps_servers_stats.deaths = 0 THEN fps_servers_stats.deaths = 1 END, TRUNCATE( fps_servers_stats.kills/fps_servers_stats.deaths, 2 ) AS kd
FROM fps_players
INNER JOIN fps_servers_stats ON fps_players.account_id = fps_servers_stats.account_id
WHERE fps_servers_stats.server_id = ' . $d . ' AND fps_servers_stats.lastconnect > 0
order by `value` desc LIMIT 10' );
endfor;
endif;
Expand All @@ -91,7 +91,7 @@
if ( ! empty( $Db->db_data['RankMeKento'] ) ):
for ($d = 0; $d < $Db->table_count['RankMeKento']; $d++ ):
// Забираем массив даннхы
$data['module_block_main_top'][] = $Db->queryAll( 'RankMeKento', $Db->db_data['RankMeKento'][$d]['USER_ID'], $Db->db_data['RankMeKento'][$d]['DB_num'],'SELECT `name`, `steam`, `connected` AS `playtime`, `score` AS `value`, `kills`, `deaths`, CASE WHEN `deaths` = 0 THEN `deaths` = 1 END, TRUNCATE( `kills`/`deaths`, 2 ) AS `kd` FROM `' . $Db->db_data['RankMeKento'][ $d ]['Table'] . '` WHERE `lastconnect` > 0 order by `value` desc LIMIT 10' );
$data['module_block_main_top'][] = $Db->queryAll( 'RankMeKento', $Db->db_data['RankMeKento'][$d]['USER_ID'], $Db->db_data['RankMeKento'][$d]['DB_num'],'SELECT `name`, steam, connected AS playtime, score AS `value`, kills, deaths, CASE WHEN deaths = 0 THEN deaths = 1 END, TRUNCATE( kills/deaths, 2 ) AS kd FROM ' . $Db->db_data['RankMeKento'][ $d ]['Table'] . ' WHERE lastconnect > 0 order by `value` desc LIMIT 10' );
endfor;
endif;

Expand Down
Loading

1 comment on commit 26fbd38

@ReDestroyDeR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему сделали этот revert?

Please sign in to comment.