fix: 베팅 대상에 들어가지 않은 국가가 성공 대상인 경우 버그

- purifyBettingKey에서 '해당 국가 없음' 에러를 내지 않도록 변경
This commit is contained in:
2022-03-27 13:11:08 +09:00
parent 967dd6fe0e
commit 116a9577b9
2 changed files with 14 additions and 4 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ class Betting
return Json::encode($bettingType);
}
public function purifyBettingKey(array $bettingType): array
public function purifyBettingKey(array $bettingType, bool $ignoreOver = false): array
{
$selectCnt = $this->info->selectCnt;
sort($bettingType, SORT_NUMERIC);
@@ -39,7 +39,7 @@ class Betting
throw new \InvalidArgumentException('올바르지 않은 값이 있습니다.(0 미만)' . print_r($bettingType, true));
}
if (Util::array_last($bettingType) >= count($this->info->candidates)) {
if (!$ignoreOver && Util::array_last($bettingType) >= count($this->info->candidates)) {
throw new \InvalidArgumentException('올바르지 않은 값이 있습니다.(초과)' . print_r($bettingType, true));
}