feat,wip: 베팅을 ng_betting 기반으로 변경

This commit is contained in:
2022-04-23 03:05:40 +09:00
parent 830e1efefe
commit 376b05a297
4 changed files with 185 additions and 148 deletions
+3 -2
View File
@@ -61,7 +61,7 @@ class Betting
if (!$noValidate) {
foreach($bettingType as $bettingKey){
if(!key_exists($bettingKey, $this->info->candidates)){
throw new \InvalidArgumentException('올바르지 않은 값이 있습니다.(후보에 없음)' . print_r($bettingType, true));
throw new \InvalidArgumentException('올바른 후보가 아닙니다.' . print_r($bettingType, true));
}
}
}
@@ -123,6 +123,7 @@ class Betting
throw new \RuntimeException('필요한 선택 수를 채우지 못했습니다.');
}
$resKey = $this->info->reqInheritancePoint?'유산포인트':'금';
$bettingTypeKey = $this->convertBettingKey($bettingType);
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
@@ -130,7 +131,7 @@ class Betting
$prevBetAmount = $db->queryFirstField('SELECT sum(amount) FROM ng_betting WHERE betting_id = %i AND user_id = %i', $this->bettingID, $userID) ?? 0;
if ($prevBetAmount + $amount > 1000) {
throw new \RuntimeException((1000 - $prevBetAmount) . ' 포인트까지만 베팅 가능합니다.');
throw new \RuntimeException((1000 - $prevBetAmount) . $resKey.'까지만 베팅 가능합니다.');
}
if ($bettingInfo->reqInheritancePoint) {