From 7e1669cc5137c797369435fdc0ba5b8dfd20becd Mon Sep 17 00:00:00 2001 From: "jisangs (iMac)" Date: Sun, 15 May 2022 23:28:56 +0900 Subject: [PATCH] Fix: history_record - app_id inline sql --- src/web/server/record/history_record.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/web/server/record/history_record.php b/src/web/server/record/history_record.php index 9741a0f..651ad58 100644 --- a/src/web/server/record/history_record.php +++ b/src/web/server/record/history_record.php @@ -27,19 +27,20 @@ function get_history_record($maestro_id, $app_id, $player_id, $date) { $query = " FROM best_record BR INNER JOIN app AS AA - ON BR.MaestroID = ? AND BR.PlayerID = ? AND DATE(BR.RecordDateTime) <= ? AND BR.AppID = ? AND BR.AppID = AA.AppID + ON BR.MaestroID = ? AND BR.PlayerID = ? AND DATE(BR.RecordDateTime) <= ? AND BR.AppID = ".$app_id." AND BR.AppID = AA.AppID GROUP BY DATE(BR.RecordDateTime) ORDER BY DATE(BR.RecordDateTime) DESC LIMIT 7 "; if(is_highest_record_prefer_app($app_id)) { - $query = "SELECT DATE(BR.RecordDateTime) AS RecordDateTime, MAX(BR.BestRecord) AS HighScore, AA.AppName AS AppName".$query; + $query = "SELECT DATE(BR.RecordDateTime) AS Date, MAX(BR.BestRecord) AS HighScore, AA.AppName AS AppName".$query; } else { - $query = "SELECT DATE(BR.RecordDateTime) AS RecordDateTime, MIN(BR.BestRecord) AS HighScore, AA.AppName AS AppName".$query; + $query = "SELECT DATE(BR.RecordDateTime) AS Date, MIN(BR.BestRecord) AS HighScore, AA.AppName AS AppName".$query; } $stmt = $db_conn->prepare($query); - $stmt->bind_param('iisi', $maestro_id, $player_id, $date, $app_id); + // $stmt->bind_param('iisi', $maestro_id, $player_id, $date, $app_id); + $stmt->bind_param('iis', $maestro_id, $player_id, $date); $stmt->execute(); $stmt->bind_result($date, $score, $app_name);