From 7a3064d37b32961a5cf6df3009b1c86d69a7d4d0 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 18 Apr 2018 23:16:05 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B2=A9=EB=B3=B4=EC=8B=9C=20=EB=B3=91?= =?UTF-8?q?=EC=A2=85=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/func_process.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/hwe/func_process.php b/hwe/func_process.php index 789612a7..30209b1e 100644 --- a/hwe/func_process.php +++ b/hwe/func_process.php @@ -1683,7 +1683,16 @@ function process_31(&$general) { $typecount = []; for($i=0; $i < $gencount; $i++) { $gen = MYDB_fetch_array($result); - if($gen['crew'] != 0) { $typecount[$gen['crewtype']]++; $crew += $gen['crew']; } + if($gen['crew'] != 0) { + if(!key_exists($gen['crewtype'], $typecount)){ + $typecount[$gen['crewtype']] = 1; + } + else{ + $typecount[$gen['crewtype']]+=1; + } + + $crew += $gen['crew']; + } } if(!key_exists($destination, $dist)) { $alllog[] = "●{$admin['month']}월:누군가가 {$city['name']}(을)를 살피는 것 같습니다."; @@ -1699,13 +1708,9 @@ function process_31(&$general) { $log[] = "●{$admin['month']}월:{$city['name']}의 많은 정보를 얻었습니다. <1>$date"; $msg[] = "【병종】"; - foreach(GameUnitConst::all() as $unit){ - if($typecount[$unit->id] == 0){ - continue; - } - - $unitStr = mb_substr($unit->name, 0, 2); - $msg[] = "{$unitStr}:{$typecount[$unit->id]}"; + foreach($typecount as $crewtype->$cnt){ + $crewtypeText = mb_substr(GameUnitConst::byID($crewtype)->name, 0, 2); + $msg[] = "{$crewtypeText}:{$cnt}"; } $log[] = join(' ', $msg);