From 6bbcb25138b989c4a9701c07a39d6ab7fc0beecf Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 4 Feb 2022 03:50:39 +0900 Subject: [PATCH] =?UTF-8?q?feat(WIP):=20=EB=B2=A0=ED=8C=85=20=EB=B3=B4?= =?UTF-8?q?=EC=83=81=20=EB=88=84=EB=9D=BD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Betting.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hwe/sammo/Betting.php b/hwe/sammo/Betting.php index 7a345bf8..bac18948 100644 --- a/hwe/sammo/Betting.php +++ b/hwe/sammo/Betting.php @@ -8,7 +8,6 @@ class Betting { private BettingInfo $info; - private ?array $typeKeyCache = null; public function __construct(private $bettingID) { @@ -207,13 +206,17 @@ class Betting $userID = $rewardItem['userID']; $inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}"); $previousPoint = ($inheritStor->getValue('previous') ?? [0, 0])[0]; - $previousPointText = number_format($previousPoint); $userLogger = new UserLogger($userID); $amount = $rewardItem['amount']; - $amountText = number_format($amount); + $nextPoint = $previousPoint + $amount; + $inheritStor->setValue('previous', [$nextPoint, 0]); + + $amountText = number_format($amount); + $previousPointText = number_format($previousPoint); $nextPointText = number_format($nextPoint); + $userLogger->push("{$this->info->name} 베팅 보상으로 {$amountText} 포인트 획득.", "inheritPoint"); $userLogger->push("포인트 {$previousPointText} => {$nextPointText}", "inheritPoint"); $userLogger->flush();