fix: 베팅 관련 사소한 버그 수정

- 베팅이 없을 경우
- 베팅 동시 신청
This commit is contained in:
2022-02-05 07:43:27 +00:00
committed by Gitea
parent 2da1957c28
commit 264db40bdc
3 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ class Bet extends \sammo\BaseAPI
public function getRequiredSessionMode(): int
{
return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY;
return static::REQ_GAME_LOGIN;
}
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
@@ -38,7 +38,6 @@ class GetBettingDetail extends \sammo\BaseAPI
{
$db = DB::db();
increaseRefresh("국가베팅장", 1);
/** @var int */
$bettingID = $this->args['betting_id'];
+12 -2
View File
@@ -36,7 +36,7 @@ class GetBettingList extends \sammo\BaseAPI
$me = $db->queryFirstRow('SELECT no,nation,officer_level,con,turntime,belong,penalty,permission FROM general WHERE owner=%i', $userID);
$con = checkLimit($me['con']);
if ($con >= 2) {
return "접속 제한중입니다. 1턴 이내에 너무 많은 갱신을 하셨습니다. (다음 갱신 가능 시각 : {$me['turntime']})";
return "접속 제한중입니다.";
}
$bettingList = [];
@@ -47,6 +47,17 @@ class GetBettingList extends \sammo\BaseAPI
$bettingList[$item->id]['totalAmount'] = 0;
}
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
if(!$bettingList){
return [
'result' => true,
'bettingList' => $bettingList,
'year' => $year,
'month' => $month,
];
}
$bettingIDList = array_keys($bettingList);
// XXX: query cache만 믿고 sum을 하는 짓을 벌여도 되는가?
foreach ($db->queryAllLists(
@@ -59,7 +70,6 @@ class GetBettingList extends \sammo\BaseAPI
$bettingList[$bettingID]['totalAmount'] = $totalAmount;
}
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
return [
'result' => true,