From 7e91b2534f80f7d531871cc6b085ae586541eb72 Mon Sep 17 00:00:00 2001 From: hide_d Date: Wed, 28 Mar 2018 05:06:38 +0900 Subject: [PATCH] =?UTF-8?q?ChangeCity=20=EB=B2=84=EA=B7=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- twe/sammo/Event/Action/ChangeCity.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/twe/sammo/Event/Action/ChangeCity.php b/twe/sammo/Event/Action/ChangeCity.php index a601823e..d2a0e11e 100644 --- a/twe/sammo/Event/Action/ChangeCity.php +++ b/twe/sammo/Event/Action/ChangeCity.php @@ -17,7 +17,7 @@ class ChangeCity extends sammo\Event\Action{ private $queries; private $cities; - public function __construct(array $cities = null, $action){ + public function __construct(array $cities = null, array $actions){ //values 포맷은 key, value로 if($cities == null){ @@ -31,7 +31,7 @@ class ChangeCity extends sammo\Event\Action{ $queries = []; foreach($actions as $key => $value){ if(!key_exists($key, self::AVAILABLE_KEY)){ - continue; + throw new \InvalidArgumentException('지원하지 않는 city 인자입니다 :'.$key); } if(!is_int($value) && !is_float($value) && !is_string($value)){ @@ -90,7 +90,7 @@ class ChangeCity extends sammo\Event\Action{ return DB::db()->sqleval('least(%b, ROUND(%b * %d, 0))', $keyMax, $key, $value); } if(is_int($value)){ - return DB::db()->sqleval('least(%b, %i)', $keyMax, $value); + return DB::db()->sqleval('least(%b, %i)', $keyMax, max(0, $value)); } $matches = null;