From 701355beb37c3408cd6d0d2e269cfd557cedfb1d Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 18 Jun 2019 03:30:09 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9C=EC=A6=8C=20=EB=B3=84=20=EA=B2=80?= =?UTF-8?q?=EC=83=89=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80,=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EA=B0=92=EC=9C=BC=EB=A1=9C=20=ED=98=84?= =?UTF-8?q?=EC=9E=AC=20=EC=8B=9C=EC=A6=8C=20=ED=91=9C=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/a_hallOfFame.php | 47 +++++++++++++++++++++++++-------------- hwe/js/hallOfFame.js | 9 +++++--- hwe/sammo/ResetHelper.php | 2 ++ 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/hwe/a_hallOfFame.php b/hwe/a_hallOfFame.php index 120f7ecc..e611d4f1 100644 --- a/hwe/a_hallOfFame.php +++ b/hwe/a_hallOfFame.php @@ -5,27 +5,34 @@ include "lib.php"; include "func.php"; $session = Session::getInstance()->setReadOnly(); -$seasonIdx = Util::getReq('seasonIdx', 'int', null); +$seasonIdx = Util::getReq('seasonIdx', 'int', UniqueConst::$seasonIdx); $scenarioIdx = Util::getReq('scenarioIdx', 'int', null); $db = DB::db(); increaseRefresh("명예의전당", 1); -$scenarioList= []; -foreach($db->query('SELECT scenario_name as name, count(scenario) as cnt, scenario from ng_games group by scenario order by scenario asc') as $scenarioInfo){ - $scenarioList[$scenarioInfo['scenario']] = $scenarioInfo; -} - - +$scenarioList = (function(){ + $db = DB::db(); + $scenarioList= []; + foreach($db->query('SELECT season, scenario_name as name, count(scenario) as cnt, scenario from ng_games group by season, scenario order by season desc, scenario asc') as $scenarioInfo){ + $seasonIdx = $scenarioInfo['season']; + $scenarioIdx = $scenarioInfo['scenario']; + if(!key_exists($seasonIdx, $scenarioList)){ + $scenarioList[$seasonIdx] = []; + } + $scenarioList[$seasonIdx][$scenarioIdx] = $scenarioInfo; + } + return $scenarioList; +})(); if($scenarioIdx !== null || key_exists($scenarioIdx, $scenarioList)){ - $searchScenarioName = $scenarioList[$scenarioIdx]['name']; - $searchFilter = $db->sqleval('scenario = %i', $scenarioIdx); + $searchScenarioName = $scenarioList[$seasonIdx][$scenarioIdx]['name']; + $searchFilter = $db->sqleval('season = %i AND scenario = %i', $seasonIdx, $scenarioIdx); } else{ $searchScenarioName = '* 모두 *'; - $searchFilter = $db->sqleval(true); + $searchFilter = $db->sqleval('season = %i', $seasonIdx); } ?> @@ -54,14 +61,20 @@ else{ 명 예 의 전 당
시나리오 검색 : diff --git a/hwe/js/hallOfFame.js b/hwe/js/hallOfFame.js index ad475cfd..9a2c165e 100644 --- a/hwe/js/hallOfFame.js +++ b/hwe/js/hallOfFame.js @@ -1,7 +1,10 @@ jQuery(function($){ $('#by_scenario').change(function(){ - var scenarioIdx = $(this).val(); - $.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx}, 'get'); + var $this = $(this); + var scenarioIdx = $this.val(); + var seasonIdx = $(this).find('option:selected').data('season'); + + + $.redirect('a_hallOfFame.php', {scenarioIdx:scenarioIdx, seasonIdx:seasonIdx}, 'get'); }) - //$.redirect("processing.php",{ commandtype: commandtype, turn: turn}, 'post'); }); \ No newline at end of file diff --git a/hwe/sammo/ResetHelper.php b/hwe/sammo/ResetHelper.php index 6525da22..b24d3830 100644 --- a/hwe/sammo/ResetHelper.php +++ b/hwe/sammo/ResetHelper.php @@ -167,6 +167,7 @@ class ResetHelper{ } $serverID = $clearResult['serverID']; + $seasonIdx = $clearResult['seasonIdx']; $scenarioObj = new Scenario($scenario, false); $scenarioObj->buildConf(); @@ -276,6 +277,7 @@ class ResetHelper{ 'date'=>$turntime, 'winner_nation'=>null, 'map'=>$scenarioObj->getMapTheme(), + 'season'=>$seasonIdx, 'scenario'=>$scenario, 'scenario_name'=>$scenarioObj->getTitle(), 'env'=>Json::encode($env)