Skip to content

Commit

Permalink
table rank avec ID
Browse files Browse the repository at this point in the history
Injection table rank avec ID
  • Loading branch information
machine62 committed Mar 14, 2020
1 parent 015d73c commit a1525fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
define('IN_SUPERAPIX', true);
define('IN_XTENSE', true);

date_default_timezone_set(date_default_timezone_get());
date_default_timezone_set(@date_default_timezone_get());

if (preg_match('#mod#', getcwd()))
chdir('../../');
Expand Down
9 changes: 5 additions & 4 deletions include/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -502,8 +502,8 @@ function traitement_alliance_rank($value, $type) {
// on fait la jointure qui va bien pour injecter le bon classement

$sql = "REPLACE INTO " . find_table_rank_alliance($type) . " ";
$sql .= " ( `datadate`, `rank`, `ally`, `number_member`, `points` , `sender_id`) ";
$sql .= " SELECT sra.datadate, sra.rank, sa.tag, sa.nb , sra.points , sra.sender_id ";
$sql .= " ( `datadate`, `rank`, `ally`, `ally_id`, `number_member`, `points` , `sender_id`) ";
$sql .= " SELECT sra.datadate, sra.rank, sa.tag, sra.id_alliance , sa.nb , sra.points , sra.sender_id ";
$sql .= " FROM " . TABLE_ALLIANCES . " as sa ";
$sql .= "INNER JOIN " . TABLE_RANK_ALLIANCES . " as sra ";
$sql .= " on sa.id_alliance = sra.id_alliance ; ";
Expand Down Expand Up @@ -565,11 +565,12 @@ function traitement_player_rank($value, $type) {
implode(',', $querys));



$table = find_table_rank_player($type);
// on fait la jointure qui va bien pour injecter le bon classement
$sql = "REPLACE INTO " . $table . " ";
$sql .= ($type != "CST_PLAYERS_RANK_MILITARY" ) ? " ( `datadate`, `rank`, `player`, `ally`, `points` , `sender_id`) " : " ( `datadate`, `rank`, `player`, `ally`, `points` , `nb_spacecraft` ,`sender_id`) ";
$sql .= ($type != "CST_PLAYERS_RANK_MILITARY" ) ? " SELECT srp.datadate, srp.rank,sp.name_player ,sa.tag, srp.points , srp.sender_id " : " SELECT srp.datadate, srp.rank,sp.name_player ,sa.tag, srp.points , srp.nb_spacecraft,srp.sender_id ";
$sql .= ($type != "CST_PLAYERS_RANK_MILITARY" ) ? " ( `datadate`, `rank`, `player`, `player_id`, `ally`, `ally_id`, `points` , `sender_id`) " : " ( `datadate`, `rank`, `player`, `player_id`, `ally`, `ally_id` , `points` , `nb_spacecraft` ,`sender_id`) ";
$sql .= ($type != "CST_PLAYERS_RANK_MILITARY" ) ? " SELECT srp.datadate, srp.rank,sp.name_player , sp.id_player ,sa.tag, sp.id_ally, srp.points , srp.sender_id " : " SELECT srp.datadate, srp.rank,sp.name_player , sp.id_player ,sa.tag,sp.id_ally, srp.points , srp.nb_spacecraft,srp.sender_id ";
$sql .= " FROM " . TABLE_PLAYERS . " as sp ";
$sql .= "INNER JOIN " . TABLE_RANK_PLAYERS . " as srp ";
$sql .= " on sp.id_player = srp.id ";
Expand Down

0 comments on commit a1525fc

Please sign in to comment.