반환하는 모든 값 중 int가 되어야하는 값들을 변경
This commit is contained in:
+14
-8
@@ -55,17 +55,17 @@ function getWorldMap($req){
|
|||||||
$db = getDB();
|
$db = getDB();
|
||||||
|
|
||||||
$game = $db->queryFirstRow('select `startyear`, `year`, `month` from `game` where `no` = 1');
|
$game = $db->queryFirstRow('select `startyear`, `year`, `month` from `game` where `no` = 1');
|
||||||
$startYear = $game['startyear'];
|
$startYear = intval($game['startyear']);
|
||||||
$year = $game['year'];
|
$year = intval($game['year']);
|
||||||
$month = $game['month'];
|
$month = intval($game['month']);
|
||||||
|
|
||||||
if($generalID && ($req->showMe || $req->neutralView)){
|
if($generalID && ($req->showMe || $req->neutralView)){
|
||||||
$city = $db->queryFirstRow(
|
$city = $db->queryFirstRow(
|
||||||
'select `city`, `nation` from `general` where `user_id`=%i',
|
'select `city`, `nation` from `general` where `user_id`=%i',
|
||||||
$generalID);
|
$generalID);
|
||||||
|
|
||||||
$myCity = $city['city'];
|
$myCity = intval($city['city']);
|
||||||
$myNation = $city['nation'];
|
$myNation = intval($city['nation']);
|
||||||
|
|
||||||
if(!$req->showMe){
|
if(!$req->showMe){
|
||||||
$myCity = null;
|
$myCity = null;
|
||||||
@@ -90,14 +90,20 @@ function getWorldMap($req){
|
|||||||
|
|
||||||
$nationList = [];
|
$nationList = [];
|
||||||
foreach($db->query('select `nation`, `name`, `color`, `capital` from `nation`') as $row){
|
foreach($db->query('select `nation`, `name`, `color`, `capital` from `nation`') as $row){
|
||||||
$nationList[] = [$row['nation'], $row['name'], $row['color'], $row['capital']];
|
$nationList[] = [
|
||||||
|
intval($row['nation']),
|
||||||
|
$row['name'],
|
||||||
|
$row['color'],
|
||||||
|
intval($row['capital'])
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($myNation){
|
if($myNation){
|
||||||
//굳이 타국 도시에 있는 아국 장수 리스트를 뽑을 이유가 없음. 일단 다 뽑자.
|
//굳이 타국 도시에 있는 아국 장수 리스트를 뽑을 이유가 없음. 일단 다 뽑자.
|
||||||
$shownByGeneralList =
|
$shownByGeneralList =
|
||||||
$db->queryFirstRow('select distinct `city` from `general` where `nation` = %i',
|
array_map('intval',
|
||||||
$myNation);
|
$db->queryFirstColumn('select distinct `city` from `general` where `nation` = %i',
|
||||||
|
$myNation));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$shownByGeneralList = [];
|
$shownByGeneralList = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user